<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>DateTime - A date and time object for Perl - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of DateTime - MetaCPAN" href="https://metacpan.org/dist/DateTime/releases.rss" />
        <link rel="canonical" href="DateTime.html" />
        <meta name="description" content="A date and time object for Perl" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/DateTime" />
<meta name="twitter:title"       content="DateTime" />
<meta name="twitter:description" content="A date and time object for Perl" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="DateTime.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of DateTime was released.">
      <span class="relatize">06 Nov 2023 05:14:16 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/DateTime">DateTime</a>
  </li>
  <li>
    Module version: 1.65
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/DateTime/source/lib/DateTime.pm">Source</a>
    (<a href="https://metacpan.org/dist/DateTime/source/lib/DateTime.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/DateTime/source/lib">Browse</a>
    (<a href="https://metacpan.org/dist/DateTime/source/lib?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/DateTime/changes">Changes</a>
    </li>
    <li>
      <a rel="noopener nofollow" class="nopopup" href="https://metacpan.org/release/DateTime">Homepage</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/DateTime/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/houseabsolute/DateTime.pm">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://github.com/houseabsolute/DateTime.pm/issues">Issues</a>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=DateTime+1.65" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/DateTime.html?oncpan=1&amp;distmat=1&amp;version=1.65&amp;grade=2" style="color: #090">1628</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/DateTime.html?oncpan=1&amp;distmat=1&amp;version=1.65&amp;grade=3" style="color: #900">4</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/DateTime.html?oncpan=1&amp;distmat=1&amp;version=1.65&amp;grade=4">1</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/DROLSKY/DateTime-1.65">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on DateTime who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      License: artistic_2
    </li>
    <li>
      Perl: v5.8.4
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/DateTime/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/DateTime-1.65.tar.gz">
      Download (<span itemprop="fileSize">316.78KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FDROLSKY%2FDateTime-1.65%2Flib%2FDateTime.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/DateTime/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/DateTime/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:DateTime">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="DateTime">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/DateTime.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="DROLSKY/DateTime-1.65"
>1.65
  (DROLSKY on 2023-11-06)</option>
<option
  
  value="DROLSKY/DateTime-1.64-TRIAL"
>1.64-TRIAL DEV
  (DROLSKY on 2023-10-29)</option>
<option
  
  value="DROLSKY/DateTime-1.63"
>1.63
  (DROLSKY on 2023-10-22)</option>
<option
  
  value="DROLSKY/DateTime-1.62-TRIAL"
>1.62-TRIAL DEV
  (DROLSKY on 2023-09-04)</option>
<option
  
  value="DROLSKY/DateTime-1.61-TRIAL"
>1.61-TRIAL DEV
  (DROLSKY on 2023-09-02)</option>
<option
  
  value="DROLSKY/DateTime-1.60-TRIAL"
>1.60-TRIAL DEV
  (DROLSKY on 2023-08-19)</option>
<option
  
  value="DROLSKY/DateTime-1.59"
>1.59
  (DROLSKY on 2022-10-23)</option>
<option
  
  value="DROLSKY/DateTime-1.58"
>1.58
  (DROLSKY on 2022-04-18)</option>
<option
  
  value="DROLSKY/DateTime-1.57"
>1.57
  (DROLSKY on 2022-03-03)</option>
<option
  
  value="DROLSKY/DateTime-1.56"
>1.56
  (DROLSKY on 2022-03-02)</option>
<option
  
  value="DROLSKY/DateTime-1.55"
>1.55
  (DROLSKY on 2021-12-23)</option>
<option
  
  value="DROLSKY/DateTime-1.54"
>1.54
  (DROLSKY on 2020-12-04)</option>
<option
  
  value="DROLSKY/DateTime-1.53"
>1.53
  (DROLSKY on 2020-11-09)</option>
<option
  
  value="DROLSKY/DateTime-1.52"
>1.52
  (DROLSKY on 2020-02-29)</option>
<option
  
  value="DROLSKY/DateTime-1.51"
>1.51
  (DROLSKY on 2019-04-21)</option>
<option
  
  value="DROLSKY/DateTime-1.50"
>1.50
  (DROLSKY on 2018-08-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="DROLSKY/DateTime-1.49"
>1.49
  (DROLSKY on 2018-05-20)</option>
<option
  
  value="DROLSKY/DateTime-1.48"
>1.48
  (DROLSKY on 2018-03-26)</option>
<option
  
  value="DROLSKY/DateTime-1.47"
>1.47
  (DROLSKY on 2018-03-25)</option>
<option
  
  value="DROLSKY/DateTime-1.46"
>1.46
  (DROLSKY on 2018-02-11)</option>
<option
  
  value="DROLSKY/DateTime-1.45"
>1.45
  (DROLSKY on 2017-12-29)</option>
<option
  
  value="DROLSKY/DateTime-1.44"
>1.44
  (DROLSKY on 2017-08-21)</option>
<option
  
  value="DROLSKY/DateTime-1.43"
>1.43
  (DROLSKY on 2017-05-29)</option>
<option
  
  value="DROLSKY/DateTime-1.42"
>1.42
  (DROLSKY on 2016-12-25)</option>
<option
  
  value="DROLSKY/DateTime-1.41"
>1.41
  (DROLSKY on 2016-11-16)</option>
<option
  
  value="DROLSKY/DateTime-1.40"
>1.40
  (DROLSKY on 2016-11-12)</option>
<option
  
  value="DROLSKY/DateTime-1.39"
>1.39
  (DROLSKY on 2016-09-18)</option>
<option
  
  value="DROLSKY/DateTime-1.38"
>1.38
  (DROLSKY on 2016-09-16)</option>
<option
  
  value="DROLSKY/DateTime-1.37-TRIAL"
>1.37-TRIAL DEV
  (DROLSKY on 2016-08-14)</option>
<option
  
  value="DROLSKY/DateTime-1.36"
>1.36
  (DROLSKY on 2016-08-06)</option>
<option
  
  value="DROLSKY/DateTime-1.35"
>1.35
  (DROLSKY on 2016-08-06)</option>
<option
  
  value="DROLSKY/DateTime-1.34"
>1.34
  (DROLSKY on 2016-07-06)</option>
<option
  
  value="DROLSKY/DateTime-1.33"
>1.33
  (DROLSKY on 2016-06-29)</option>
<option
  
  value="DROLSKY/DateTime-1.32"
>1.32
  (DROLSKY on 2016-06-29)</option>
<option
  
  value="DROLSKY/DateTime-1.31-TRIAL"
>1.31-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.30-TRIAL"
>1.30-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.29-TRIAL"
>1.29-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.28"
>1.28
  (DROLSKY on 2016-05-21)</option>
<option
  
  value="DROLSKY/DateTime-1.27"
>1.27
  (DROLSKY on 2016-05-13)</option>
<option
  
  value="DROLSKY/DateTime-1.26"
>1.26
  (DROLSKY on 2016-03-21)</option>
<option
  
  value="DROLSKY/DateTime-1.25"
>1.25
  (DROLSKY on 2016-03-06)</option>
<option
  
  value="DROLSKY/DateTime-1.24"
>1.24
  (DROLSKY on 2016-02-29)</option>
<option
  
  value="DROLSKY/DateTime-1.23"
>1.23
  (DROLSKY on 2016-02-28)</option>
<option
  
  value="DROLSKY/DateTime-1.22-TRIAL"
>1.22-TRIAL DEV
  (DROLSKY on 2016-02-21)</option>
<option
  
  value="DROLSKY/DateTime-1.21"
>1.21
  (DROLSKY on 2015-09-30)</option>
<option
  
  value="DROLSKY/DateTime-1.20"
>1.20
  (DROLSKY on 2015-07-01)</option>
<option
  
  value="DROLSKY/DateTime-1.19"
>1.19
  (DROLSKY on 2015-05-31)</option>
<option
  
  value="DROLSKY/DateTime-1.18"
>1.18
  (DROLSKY on 2015-01-05)</option>
<option
  
  value="DROLSKY/DateTime-1.17"
>1.17
  (DROLSKY on 2015-01-05)</option>
<option
  
  value="DROLSKY/DateTime-1.16-TRIAL"
>1.16-TRIAL DEV
  (DROLSKY on 2015-01-04)</option>
<option
  
  value="DROLSKY/DateTime-1.15-TRIAL"
>1.15-TRIAL DEV
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.14"
>1.14
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.13"
>1.13
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.12"
>1.12
  (DROLSKY on 2014-08-31)</option>
<option
  
  value="DROLSKY/DateTime-1.11"
>1.11
  (DROLSKY on 2014-08-31)</option>
<option
  
  value="DROLSKY/DateTime-1.10"
>1.10
  (DROLSKY on 2014-05-05)</option>
<option
  
  value="DROLSKY/DateTime-1.09"
>1.09
  (DROLSKY on 2014-05-03)</option>
<option
  
  value="DROLSKY/DateTime-1.08"
>1.08
  (DROLSKY on 2014-03-11)</option>
<option
  
  value="DROLSKY/DateTime-1.07"
>1.07
  (DROLSKY on 2014-02-07)</option>
<option
  
  value="DROLSKY/DateTime-1.06"
>1.06
  (DROLSKY on 2013-12-31)</option>
<option
  
  value="DROLSKY/DateTime-1.05"
>1.05
  (DROLSKY on 2013-12-22)</option>
<option
  
  value="DROLSKY/DateTime-1.04"
>1.04
  (DROLSKY on 2013-12-07)</option>
<option
  
  value="DROLSKY/DateTime-1.03"
>1.03
  (DROLSKY on 2013-04-17)</option>
<option
  
  value="DROLSKY/DateTime-1.02"
>1.02
  (DROLSKY on 2013-04-16)</option>
<option
  
  value="DROLSKY/DateTime-1.01"
>1.01
  (DROLSKY on 2013-04-01)</option>
<option
  
  value="DROLSKY/DateTime-1.00"
>1.00
  (DROLSKY on 2013-03-31)</option>
<option
  
  value="DROLSKY/DateTime-0.78"
>0.78
  (DROLSKY on 2012-11-16)</option>
<option
  
  value="DROLSKY/DateTime-0.77"
>0.77
  (DROLSKY on 2012-09-25)</option>
<option
  
  value="DROLSKY/DateTime-0.76"
>0.76
  (DROLSKY on 2012-07-01)</option>
<option
  
  value="DROLSKY/DateTime-0.75"
>0.75
  (DROLSKY on 2012-06-11)</option>
<option
  
  value="DROLSKY/DateTime-0.74"
>0.74
  (DROLSKY on 2012-03-22)</option>
<option
  
  value="DROLSKY/DateTime-0.73"
>0.73
  (DROLSKY on 2012-03-17)</option>
<option
  
  value="DROLSKY/DateTime-0.72"
>0.72
  (DROLSKY on 2012-01-05)</option>
<option
  
  value="DROLSKY/DateTime-0.71"
>0.71
  (DROLSKY on 2012-01-05)</option>
<option
  
  value="DROLSKY/DateTime-0.70"
>0.70
  (DROLSKY on 2011-05-09)</option>
<option
  
  value="DROLSKY/DateTime-0.69"
>0.69
  (DROLSKY on 2011-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.68"
>0.68
  (DROLSKY on 2011-04-25)</option>
<option
  
  value="DROLSKY/DateTime-0.67"
>0.67
  (DROLSKY on 2011-04-24)</option>
<option
  
  value="DROLSKY/DateTime-0.66"
>0.66
  (DROLSKY on 2010-11-26)</option>
<option
  
  value="DROLSKY/DateTime-0.65"
>0.65
  (DROLSKY on 2010-10-26)</option>
<option
  
  value="DROLSKY/DateTime-0.64"
>0.64
  (DROLSKY on 2010-10-26)</option>
<option
  
  value="DROLSKY/DateTime-0.63"
>0.63
  (DROLSKY on 2010-09-25)</option>
<option
  
  value="DROLSKY/DateTime-0.62"
>0.62
  (DROLSKY on 2010-09-23)</option>
<option
  
  value="DROLSKY/DateTime-0.61"
>0.61
  (DROLSKY on 2010-07-17)</option>
<option
  
  value="DROLSKY/DateTime-0.60"
>0.60
  (DROLSKY on 2010-07-03)</option>
<option
  
  value="DROLSKY/DateTime-0.59"
>0.59
  (DROLSKY on 2010-06-29)</option>
<option
  
  value="DROLSKY/DateTime-0.58"
>0.58
  (DROLSKY on 2010-06-28)</option>
<option
  
  value="DROLSKY/DateTime-0.57"
>0.57
  (DROLSKY on 2010-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.56"
>0.56
  (DROLSKY on 2010-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.55"
>0.55
  (DROLSKY on 2010-03-16)</option>
<option
  
  value="DROLSKY/DateTime-0.54"
>0.54
  (DROLSKY on 2010-03-14)</option>
<option
  
  value="DROLSKY/DateTime-0.53"
>0.53
  (DROLSKY on 2009-12-06)</option>
<option
  
  value="DROLSKY/DateTime-0.52"
>0.52
  (DROLSKY on 2009-12-05)</option>
<option
  
  value="DROLSKY/DateTime-0.51"
>0.51
  (DROLSKY on 2009-11-01)</option>
<option
  
  value="DROLSKY/DateTime-0.50"
>0.50
  (DROLSKY on 2009-05-11)</option>
<option
  
  value="DROLSKY/DateTime-0.49"
>0.49
  (DROLSKY on 2009-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.48"
>0.48
  (DROLSKY on 2009-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.47"
>0.47
  (DROLSKY on 2009-03-01)</option>
<option
  
  value="DROLSKY/DateTime-0.46"
>0.46
  (DROLSKY on 2009-02-28)</option>
<option
  
  value="DROLSKY/DateTime-0.4501"
>0.4501
  (DROLSKY on 2008-11-25)</option>
<option
  
  value="DROLSKY/DateTime-0.45"
>0.45
  (DROLSKY on 2008-11-12)</option>
<option
  
  value="DROLSKY/DateTime-0.4401"
>0.4401
  (DROLSKY on 2008-11-03)</option>
<option
  
  value="DROLSKY/DateTime-0.44"
>0.44
  (DROLSKY on 2008-11-01)</option>
<option
  
  value="DROLSKY/DateTime-0.4305"
>0.4305
  (DROLSKY on 2008-10-03)</option>
<option
  
  value="DROLSKY/DateTime-0.4304"
>0.4304
  (DROLSKY on 2008-07-13)</option>
<option
  
  value="DROLSKY/DateTime-0.4303"
>0.4303
  (DROLSKY on 2008-07-12)</option>
<option
  
  value="DROLSKY/DateTime-0.4302"
>0.4302
  (DROLSKY on 2008-05-20)</option>
<option
  
  value="DROLSKY/DateTime-0.4301"
>0.4301
  (DROLSKY on 2008-05-18)</option>
<option
  
  value="DROLSKY/DateTime-0.43"
>0.43
  (DROLSKY on 2008-05-18)</option>
<option
  
  value="DROLSKY/DateTime-0.42"
>0.42
  (DROLSKY on 2008-02-29)</option>
<option
  
  value="DROLSKY/DateTime-0.41"
>0.41
  (DROLSKY on 2007-09-10)</option>
<option
  
  value="DROLSKY/DateTime-0.40"
>0.40
  (DROLSKY on 2007-08-30)</option>
<option
  
  value="DROLSKY/DateTime-0.39"
>0.39
  (DROLSKY on 2007-07-17)</option>
<option
  
  value="DROLSKY/DateTime-0.38"
>0.38
  (DROLSKY on 2007-07-01)</option>
<option
  
  value="DROLSKY/DateTime-0.37"
>0.37
  (DROLSKY on 2007-03-30)</option>
<option
  
  value="DROLSKY/DateTime-0.36"
>0.36
  (DROLSKY on 2007-01-18)</option>
<option
  
  value="DROLSKY/DateTime-0.35"
>0.35
  (DROLSKY on 2006-10-22)</option>
<option
  
  value="DROLSKY/DateTime-0.34"
>0.34
  (DROLSKY on 2006-08-11)</option>
<option
  
  value="DROLSKY/DateTime-0.33"
>0.33
  (DROLSKY on 2006-08-09)</option>
<option
  
  value="DROLSKY/DateTime-0.32"
>0.32
  (DROLSKY on 2006-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.31"
>0.31
  (DROLSKY on 2006-05-21)</option>
<option
  
  value="DROLSKY/DateTime-0.30"
>0.30
  (DROLSKY on 2005-12-22)</option>
<option
  
  value="DROLSKY/DateTime-0.2901"
>0.2901
  (DROLSKY on 2005-07-04)</option>
<option
  
  value="DROLSKY/DateTime-0.29"
>0.29
  (DROLSKY on 2005-06-03)</option>
<option
  
  value="DROLSKY/DateTime-0.28"
>0.28
  (DROLSKY on 2005-02-28)</option>
<option
  
  value="DROLSKY/DateTime-0.27"
>0.27
  (DROLSKY on 2005-01-31)</option>
<option
  
  value="DROLSKY/DateTime-0.26"
>0.26
  (DROLSKY on 2005-01-27)</option>
<option
  
  value="DROLSKY/DateTime-0.25"
>0.25
  (DROLSKY on 2005-01-11)</option>
<option
  
  value="DROLSKY/DateTime-0.24"
>0.24
  (DROLSKY on 2004-12-10)</option>
<option
  
  value="DROLSKY/DateTime-0.23"
>0.23
  (DROLSKY on 2004-12-09)</option>
<option
  
  value="DROLSKY/DateTime-0.22"
>0.22
  (DROLSKY on 2004-07-23)</option>
<option
  
  value="DROLSKY/DateTime-0.2101"
>0.2101
  (DROLSKY on 2004-06-10)</option>
<option
  
  value="DROLSKY/DateTime-0.21"
>0.21
  (DROLSKY on 2004-03-28)</option>
<option
  
  value="DROLSKY/DateTime-0.20"
>0.20
  (DROLSKY on 2004-02-12)</option>
<option
  
  value="DROLSKY/DateTime-0.1901"
>0.1901
  (DROLSKY on 2004-01-07)</option>
<option
  
  value="DROLSKY/DateTime-0.19"
>0.19
  (DROLSKY on 2003-12-02)</option>
<option
  
  value="DROLSKY/DateTime-0.18"
>0.18
  (DROLSKY on 2003-10-27)</option>
<option
  
  value="DROLSKY/DateTime-0.1705"
>0.1705
  (DROLSKY on 2003-10-07)</option>
<option
  
  value="DROLSKY/DateTime-0.1704"
>0.1704
  (DROLSKY on 2003-10-07)</option>
<option
  
  value="DROLSKY/DateTime-0.1703"
>0.1703
  (DROLSKY on 2003-09-22)</option>
<option
  
  value="DROLSKY/DateTime-0.1702"
>0.1702
  (DROLSKY on 2003-09-18)</option>
<option
  
  value="DROLSKY/DateTime-0.1701"
>0.1701
  (DROLSKY on 2003-09-15)</option>
<option
  
  value="DROLSKY/DateTime-0.17"
>0.17
  (DROLSKY on 2003-08-29)</option>
<option
  
  value="DROLSKY/DateTime-0.1601"
>0.1601
  (DROLSKY on 2003-08-07)</option>
<option
  
  value="DROLSKY/DateTime-0.16"
>0.16
  (DROLSKY on 2003-08-06)</option>
<option
  
  value="DROLSKY/DateTime-0.1503"
>0.1503
  (DROLSKY on 2003-07-31)</option>
<option
  
  value="DROLSKY/DateTime-0.1502"
>0.1502
  (DROLSKY on 2003-07-31)</option>
<option
  
  value="DROLSKY/DateTime-0.1501"
>0.1501
  (DROLSKY on 2003-07-30)</option>
<option
  
  value="DROLSKY/DateTime-0.15"
>0.15
  (DROLSKY on 2003-07-29)</option>
<option
  
  value="DROLSKY/DateTime-0.1402"
>0.1402
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.1401"
>0.1401
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.14"
>0.14
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.13"
>0.13
  (DROLSKY on 2003-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.12"
>0.12
  (DROLSKY on 2003-05-05)</option>
<option
  
  value="DROLSKY/DateTime-0.11"
>0.11
  (DROLSKY on 2003-05-03)</option>
<option
  
  value="DROLSKY/DateTime-0.10"
>0.10
  (DROLSKY on 2003-04-19)</option>
<option
  
  value="PGOLLUCCI/DateTime-0.01"
>0.01
  (PGOLLUCCI on 2003-04-17)</option>
<option
  
  value="DROLSKY/DateTime-0.09"
>0.09
  (DROLSKY on 2003-04-05)</option>
<option
  
  value="DROLSKY/DateTime-0.08"
>0.08
  (DROLSKY on 2003-03-21)</option>
<option
  
  value="DROLSKY/DateTime-0.07"
>0.07
  (DROLSKY on 2003-02-27)</option>
<option
  
  value="DROLSKY/DateTime-0.06"
>0.06
  (DROLSKY on 2003-02-16)</option>
<option
  
  value="DROLSKY/DateTime-0.05"
>0.05
  (DROLSKY on 2003-02-14)</option>
<option
  
  value="DROLSKY/DateTime-0.03"
>0.03
  (DROLSKY on 2003-02-09)</option>
<option
  
  value="DROLSKY/DateTime-0.02"
>0.02
  (DROLSKY on 2003-02-09)</option>
<option
  
  value="DROLSKY/DateTime-0.01_00"
>0.01_00 DEV
  (DROLSKY on 2003-02-04)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/DROLSKY/DateTime-1.65/diff/' + encodeURIComponent(this.value) + '/lib/DateTime.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="DROLSKY/DateTime-1.65"
>1.65
  (DROLSKY on 2023-11-06)</option>
<option
  
  value="DROLSKY/DateTime-1.64-TRIAL"
>1.64-TRIAL DEV
  (DROLSKY on 2023-10-29)</option>
<option
  
  value="DROLSKY/DateTime-1.63"
>1.63
  (DROLSKY on 2023-10-22)</option>
<option
  
  value="DROLSKY/DateTime-1.62-TRIAL"
>1.62-TRIAL DEV
  (DROLSKY on 2023-09-04)</option>
<option
  
  value="DROLSKY/DateTime-1.61-TRIAL"
>1.61-TRIAL DEV
  (DROLSKY on 2023-09-02)</option>
<option
  
  value="DROLSKY/DateTime-1.60-TRIAL"
>1.60-TRIAL DEV
  (DROLSKY on 2023-08-19)</option>
<option
  
  value="DROLSKY/DateTime-1.59"
>1.59
  (DROLSKY on 2022-10-23)</option>
<option
  
  value="DROLSKY/DateTime-1.58"
>1.58
  (DROLSKY on 2022-04-18)</option>
<option
  
  value="DROLSKY/DateTime-1.57"
>1.57
  (DROLSKY on 2022-03-03)</option>
<option
  
  value="DROLSKY/DateTime-1.56"
>1.56
  (DROLSKY on 2022-03-02)</option>
<option
  
  value="DROLSKY/DateTime-1.55"
>1.55
  (DROLSKY on 2021-12-23)</option>
<option
  
  value="DROLSKY/DateTime-1.54"
>1.54
  (DROLSKY on 2020-12-04)</option>
<option
  
  value="DROLSKY/DateTime-1.53"
>1.53
  (DROLSKY on 2020-11-09)</option>
<option
  
  value="DROLSKY/DateTime-1.52"
>1.52
  (DROLSKY on 2020-02-29)</option>
<option
  
  value="DROLSKY/DateTime-1.51"
>1.51
  (DROLSKY on 2019-04-21)</option>
<option
  
  value="DROLSKY/DateTime-1.50"
>1.50
  (DROLSKY on 2018-08-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="DROLSKY/DateTime-1.49"
>1.49
  (DROLSKY on 2018-05-20)</option>
<option
  
  value="DROLSKY/DateTime-1.48"
>1.48
  (DROLSKY on 2018-03-26)</option>
<option
  
  value="DROLSKY/DateTime-1.47"
>1.47
  (DROLSKY on 2018-03-25)</option>
<option
  
  value="DROLSKY/DateTime-1.46"
>1.46
  (DROLSKY on 2018-02-11)</option>
<option
  
  value="DROLSKY/DateTime-1.45"
>1.45
  (DROLSKY on 2017-12-29)</option>
<option
  
  value="DROLSKY/DateTime-1.44"
>1.44
  (DROLSKY on 2017-08-21)</option>
<option
  
  value="DROLSKY/DateTime-1.43"
>1.43
  (DROLSKY on 2017-05-29)</option>
<option
  
  value="DROLSKY/DateTime-1.42"
>1.42
  (DROLSKY on 2016-12-25)</option>
<option
  
  value="DROLSKY/DateTime-1.41"
>1.41
  (DROLSKY on 2016-11-16)</option>
<option
  
  value="DROLSKY/DateTime-1.40"
>1.40
  (DROLSKY on 2016-11-12)</option>
<option
  
  value="DROLSKY/DateTime-1.39"
>1.39
  (DROLSKY on 2016-09-18)</option>
<option
  
  value="DROLSKY/DateTime-1.38"
>1.38
  (DROLSKY on 2016-09-16)</option>
<option
  
  value="DROLSKY/DateTime-1.37-TRIAL"
>1.37-TRIAL DEV
  (DROLSKY on 2016-08-14)</option>
<option
  
  value="DROLSKY/DateTime-1.36"
>1.36
  (DROLSKY on 2016-08-06)</option>
<option
  
  value="DROLSKY/DateTime-1.35"
>1.35
  (DROLSKY on 2016-08-06)</option>
<option
  
  value="DROLSKY/DateTime-1.34"
>1.34
  (DROLSKY on 2016-07-06)</option>
<option
  
  value="DROLSKY/DateTime-1.33"
>1.33
  (DROLSKY on 2016-06-29)</option>
<option
  
  value="DROLSKY/DateTime-1.32"
>1.32
  (DROLSKY on 2016-06-29)</option>
<option
  
  value="DROLSKY/DateTime-1.31-TRIAL"
>1.31-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.30-TRIAL"
>1.30-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.29-TRIAL"
>1.29-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.28"
>1.28
  (DROLSKY on 2016-05-21)</option>
<option
  
  value="DROLSKY/DateTime-1.27"
>1.27
  (DROLSKY on 2016-05-13)</option>
<option
  
  value="DROLSKY/DateTime-1.26"
>1.26
  (DROLSKY on 2016-03-21)</option>
<option
  
  value="DROLSKY/DateTime-1.25"
>1.25
  (DROLSKY on 2016-03-06)</option>
<option
  
  value="DROLSKY/DateTime-1.24"
>1.24
  (DROLSKY on 2016-02-29)</option>
<option
  
  value="DROLSKY/DateTime-1.23"
>1.23
  (DROLSKY on 2016-02-28)</option>
<option
  
  value="DROLSKY/DateTime-1.22-TRIAL"
>1.22-TRIAL DEV
  (DROLSKY on 2016-02-21)</option>
<option
  
  value="DROLSKY/DateTime-1.21"
>1.21
  (DROLSKY on 2015-09-30)</option>
<option
  
  value="DROLSKY/DateTime-1.20"
>1.20
  (DROLSKY on 2015-07-01)</option>
<option
  
  value="DROLSKY/DateTime-1.19"
>1.19
  (DROLSKY on 2015-05-31)</option>
<option
  
  value="DROLSKY/DateTime-1.18"
>1.18
  (DROLSKY on 2015-01-05)</option>
<option
  
  value="DROLSKY/DateTime-1.17"
>1.17
  (DROLSKY on 2015-01-05)</option>
<option
  
  value="DROLSKY/DateTime-1.16-TRIAL"
>1.16-TRIAL DEV
  (DROLSKY on 2015-01-04)</option>
<option
  
  value="DROLSKY/DateTime-1.15-TRIAL"
>1.15-TRIAL DEV
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.14"
>1.14
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.13"
>1.13
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.12"
>1.12
  (DROLSKY on 2014-08-31)</option>
<option
  
  value="DROLSKY/DateTime-1.11"
>1.11
  (DROLSKY on 2014-08-31)</option>
<option
  
  value="DROLSKY/DateTime-1.10"
>1.10
  (DROLSKY on 2014-05-05)</option>
<option
  
  value="DROLSKY/DateTime-1.09"
>1.09
  (DROLSKY on 2014-05-03)</option>
<option
  
  value="DROLSKY/DateTime-1.08"
>1.08
  (DROLSKY on 2014-03-11)</option>
<option
  
  value="DROLSKY/DateTime-1.07"
>1.07
  (DROLSKY on 2014-02-07)</option>
<option
  
  value="DROLSKY/DateTime-1.06"
>1.06
  (DROLSKY on 2013-12-31)</option>
<option
  
  value="DROLSKY/DateTime-1.05"
>1.05
  (DROLSKY on 2013-12-22)</option>
<option
  
  value="DROLSKY/DateTime-1.04"
>1.04
  (DROLSKY on 2013-12-07)</option>
<option
  
  value="DROLSKY/DateTime-1.03"
>1.03
  (DROLSKY on 2013-04-17)</option>
<option
  
  value="DROLSKY/DateTime-1.02"
>1.02
  (DROLSKY on 2013-04-16)</option>
<option
  
  value="DROLSKY/DateTime-1.01"
>1.01
  (DROLSKY on 2013-04-01)</option>
<option
  
  value="DROLSKY/DateTime-1.00"
>1.00
  (DROLSKY on 2013-03-31)</option>
<option
  
  value="DROLSKY/DateTime-0.78"
>0.78
  (DROLSKY on 2012-11-16)</option>
<option
  
  value="DROLSKY/DateTime-0.77"
>0.77
  (DROLSKY on 2012-09-25)</option>
<option
  
  value="DROLSKY/DateTime-0.76"
>0.76
  (DROLSKY on 2012-07-01)</option>
<option
  
  value="DROLSKY/DateTime-0.75"
>0.75
  (DROLSKY on 2012-06-11)</option>
<option
  
  value="DROLSKY/DateTime-0.74"
>0.74
  (DROLSKY on 2012-03-22)</option>
<option
  
  value="DROLSKY/DateTime-0.73"
>0.73
  (DROLSKY on 2012-03-17)</option>
<option
  
  value="DROLSKY/DateTime-0.72"
>0.72
  (DROLSKY on 2012-01-05)</option>
<option
  
  value="DROLSKY/DateTime-0.71"
>0.71
  (DROLSKY on 2012-01-05)</option>
<option
  
  value="DROLSKY/DateTime-0.70"
>0.70
  (DROLSKY on 2011-05-09)</option>
<option
  
  value="DROLSKY/DateTime-0.69"
>0.69
  (DROLSKY on 2011-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.68"
>0.68
  (DROLSKY on 2011-04-25)</option>
<option
  
  value="DROLSKY/DateTime-0.67"
>0.67
  (DROLSKY on 2011-04-24)</option>
<option
  
  value="DROLSKY/DateTime-0.66"
>0.66
  (DROLSKY on 2010-11-26)</option>
<option
  
  value="DROLSKY/DateTime-0.65"
>0.65
  (DROLSKY on 2010-10-26)</option>
<option
  
  value="DROLSKY/DateTime-0.64"
>0.64
  (DROLSKY on 2010-10-26)</option>
<option
  
  value="DROLSKY/DateTime-0.63"
>0.63
  (DROLSKY on 2010-09-25)</option>
<option
  
  value="DROLSKY/DateTime-0.62"
>0.62
  (DROLSKY on 2010-09-23)</option>
<option
  
  value="DROLSKY/DateTime-0.61"
>0.61
  (DROLSKY on 2010-07-17)</option>
<option
  
  value="DROLSKY/DateTime-0.60"
>0.60
  (DROLSKY on 2010-07-03)</option>
<option
  
  value="DROLSKY/DateTime-0.59"
>0.59
  (DROLSKY on 2010-06-29)</option>
<option
  
  value="DROLSKY/DateTime-0.58"
>0.58
  (DROLSKY on 2010-06-28)</option>
<option
  
  value="DROLSKY/DateTime-0.57"
>0.57
  (DROLSKY on 2010-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.56"
>0.56
  (DROLSKY on 2010-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.55"
>0.55
  (DROLSKY on 2010-03-16)</option>
<option
  
  value="DROLSKY/DateTime-0.54"
>0.54
  (DROLSKY on 2010-03-14)</option>
<option
  
  value="DROLSKY/DateTime-0.53"
>0.53
  (DROLSKY on 2009-12-06)</option>
<option
  
  value="DROLSKY/DateTime-0.52"
>0.52
  (DROLSKY on 2009-12-05)</option>
<option
  
  value="DROLSKY/DateTime-0.51"
>0.51
  (DROLSKY on 2009-11-01)</option>
<option
  
  value="DROLSKY/DateTime-0.50"
>0.50
  (DROLSKY on 2009-05-11)</option>
<option
  
  value="DROLSKY/DateTime-0.49"
>0.49
  (DROLSKY on 2009-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.48"
>0.48
  (DROLSKY on 2009-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.47"
>0.47
  (DROLSKY on 2009-03-01)</option>
<option
  
  value="DROLSKY/DateTime-0.46"
>0.46
  (DROLSKY on 2009-02-28)</option>
<option
  
  value="DROLSKY/DateTime-0.4501"
>0.4501
  (DROLSKY on 2008-11-25)</option>
<option
  
  value="DROLSKY/DateTime-0.45"
>0.45
  (DROLSKY on 2008-11-12)</option>
<option
  
  value="DROLSKY/DateTime-0.4401"
>0.4401
  (DROLSKY on 2008-11-03)</option>
<option
  
  value="DROLSKY/DateTime-0.44"
>0.44
  (DROLSKY on 2008-11-01)</option>
<option
  
  value="DROLSKY/DateTime-0.4305"
>0.4305
  (DROLSKY on 2008-10-03)</option>
<option
  
  value="DROLSKY/DateTime-0.4304"
>0.4304
  (DROLSKY on 2008-07-13)</option>
<option
  
  value="DROLSKY/DateTime-0.4303"
>0.4303
  (DROLSKY on 2008-07-12)</option>
<option
  
  value="DROLSKY/DateTime-0.4302"
>0.4302
  (DROLSKY on 2008-05-20)</option>
<option
  
  value="DROLSKY/DateTime-0.4301"
>0.4301
  (DROLSKY on 2008-05-18)</option>
<option
  
  value="DROLSKY/DateTime-0.43"
>0.43
  (DROLSKY on 2008-05-18)</option>
<option
  
  value="DROLSKY/DateTime-0.42"
>0.42
  (DROLSKY on 2008-02-29)</option>
<option
  
  value="DROLSKY/DateTime-0.41"
>0.41
  (DROLSKY on 2007-09-10)</option>
<option
  
  value="DROLSKY/DateTime-0.40"
>0.40
  (DROLSKY on 2007-08-30)</option>
<option
  
  value="DROLSKY/DateTime-0.39"
>0.39
  (DROLSKY on 2007-07-17)</option>
<option
  
  value="DROLSKY/DateTime-0.38"
>0.38
  (DROLSKY on 2007-07-01)</option>
<option
  
  value="DROLSKY/DateTime-0.37"
>0.37
  (DROLSKY on 2007-03-30)</option>
<option
  
  value="DROLSKY/DateTime-0.36"
>0.36
  (DROLSKY on 2007-01-18)</option>
<option
  
  value="DROLSKY/DateTime-0.35"
>0.35
  (DROLSKY on 2006-10-22)</option>
<option
  
  value="DROLSKY/DateTime-0.34"
>0.34
  (DROLSKY on 2006-08-11)</option>
<option
  
  value="DROLSKY/DateTime-0.33"
>0.33
  (DROLSKY on 2006-08-09)</option>
<option
  
  value="DROLSKY/DateTime-0.32"
>0.32
  (DROLSKY on 2006-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.31"
>0.31
  (DROLSKY on 2006-05-21)</option>
<option
  
  value="DROLSKY/DateTime-0.30"
>0.30
  (DROLSKY on 2005-12-22)</option>
<option
  
  value="DROLSKY/DateTime-0.2901"
>0.2901
  (DROLSKY on 2005-07-04)</option>
<option
  
  value="DROLSKY/DateTime-0.29"
>0.29
  (DROLSKY on 2005-06-03)</option>
<option
  
  value="DROLSKY/DateTime-0.28"
>0.28
  (DROLSKY on 2005-02-28)</option>
<option
  
  value="DROLSKY/DateTime-0.27"
>0.27
  (DROLSKY on 2005-01-31)</option>
<option
  
  value="DROLSKY/DateTime-0.26"
>0.26
  (DROLSKY on 2005-01-27)</option>
<option
  
  value="DROLSKY/DateTime-0.25"
>0.25
  (DROLSKY on 2005-01-11)</option>
<option
  
  value="DROLSKY/DateTime-0.24"
>0.24
  (DROLSKY on 2004-12-10)</option>
<option
  
  value="DROLSKY/DateTime-0.23"
>0.23
  (DROLSKY on 2004-12-09)</option>
<option
  
  value="DROLSKY/DateTime-0.22"
>0.22
  (DROLSKY on 2004-07-23)</option>
<option
  
  value="DROLSKY/DateTime-0.2101"
>0.2101
  (DROLSKY on 2004-06-10)</option>
<option
  
  value="DROLSKY/DateTime-0.21"
>0.21
  (DROLSKY on 2004-03-28)</option>
<option
  
  value="DROLSKY/DateTime-0.20"
>0.20
  (DROLSKY on 2004-02-12)</option>
<option
  
  value="DROLSKY/DateTime-0.1901"
>0.1901
  (DROLSKY on 2004-01-07)</option>
<option
  
  value="DROLSKY/DateTime-0.19"
>0.19
  (DROLSKY on 2003-12-02)</option>
<option
  
  value="DROLSKY/DateTime-0.18"
>0.18
  (DROLSKY on 2003-10-27)</option>
<option
  
  value="DROLSKY/DateTime-0.1705"
>0.1705
  (DROLSKY on 2003-10-07)</option>
<option
  
  value="DROLSKY/DateTime-0.1704"
>0.1704
  (DROLSKY on 2003-10-07)</option>
<option
  
  value="DROLSKY/DateTime-0.1703"
>0.1703
  (DROLSKY on 2003-09-22)</option>
<option
  
  value="DROLSKY/DateTime-0.1702"
>0.1702
  (DROLSKY on 2003-09-18)</option>
<option
  
  value="DROLSKY/DateTime-0.1701"
>0.1701
  (DROLSKY on 2003-09-15)</option>
<option
  
  value="DROLSKY/DateTime-0.17"
>0.17
  (DROLSKY on 2003-08-29)</option>
<option
  
  value="DROLSKY/DateTime-0.1601"
>0.1601
  (DROLSKY on 2003-08-07)</option>
<option
  
  value="DROLSKY/DateTime-0.16"
>0.16
  (DROLSKY on 2003-08-06)</option>
<option
  
  value="DROLSKY/DateTime-0.1503"
>0.1503
  (DROLSKY on 2003-07-31)</option>
<option
  
  value="DROLSKY/DateTime-0.1502"
>0.1502
  (DROLSKY on 2003-07-31)</option>
<option
  
  value="DROLSKY/DateTime-0.1501"
>0.1501
  (DROLSKY on 2003-07-30)</option>
<option
  
  value="DROLSKY/DateTime-0.15"
>0.15
  (DROLSKY on 2003-07-29)</option>
<option
  
  value="DROLSKY/DateTime-0.1402"
>0.1402
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.1401"
>0.1401
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.14"
>0.14
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.13"
>0.13
  (DROLSKY on 2003-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.12"
>0.12
  (DROLSKY on 2003-05-05)</option>
<option
  
  value="DROLSKY/DateTime-0.11"
>0.11
  (DROLSKY on 2003-05-03)</option>
<option
  
  value="DROLSKY/DateTime-0.10"
>0.10
  (DROLSKY on 2003-04-19)</option>
<option
  
  value="PGOLLUCCI/DateTime-0.01"
>0.01
  (PGOLLUCCI on 2003-04-17)</option>
<option
  
  value="DROLSKY/DateTime-0.09"
>0.09
  (DROLSKY on 2003-04-05)</option>
<option
  
  value="DROLSKY/DateTime-0.08"
>0.08
  (DROLSKY on 2003-03-21)</option>
<option
  
  value="DROLSKY/DateTime-0.07"
>0.07
  (DROLSKY on 2003-02-27)</option>
<option
  
  value="DROLSKY/DateTime-0.06"
>0.06
  (DROLSKY on 2003-02-16)</option>
<option
  
  value="DROLSKY/DateTime-0.05"
>0.05
  (DROLSKY on 2003-02-14)</option>
<option
  
  value="DROLSKY/DateTime-0.03"
>0.03
  (DROLSKY on 2003-02-09)</option>
<option
  
  value="DROLSKY/DateTime-0.02"
>0.02
  (DROLSKY on 2003-02-09)</option>
<option
  
  value="DROLSKY/DateTime-0.01_00"
>0.01_00 DEV
  (DROLSKY on 2003-02-04)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Carp" title="Carp" class="ellipsis">Carp</a></li>
  <li><a href="https://metacpan.org/pod/DateTime::Locale" title="DateTime::Locale" class="ellipsis">DateTime::Locale</a></li>
  <li><a href="https://metacpan.org/pod/DateTime::TimeZone" title="DateTime::TimeZone" class="ellipsis">DateTime::TimeZone</a></li>
  <li><a href="https://metacpan.org/pod/Dist::CheckConflicts" title="Dist::CheckConflicts" class="ellipsis">Dist::CheckConflicts</a></li>
  <li><a href="https://metacpan.org/pod/POSIX" title="POSIX" class="ellipsis">POSIX</a></li>
  <li><a href="https://metacpan.org/pod/Params::ValidationCompiler" title="Params::ValidationCompiler" class="ellipsis">Params::ValidationCompiler</a></li>
  <li><a href="https://metacpan.org/pod/Scalar::Util" title="Scalar::Util" class="ellipsis">Scalar::Util</a></li>
  <li><a href="https://metacpan.org/pod/Specio" title="Specio" class="ellipsis">Specio</a></li>
  <li><a href="https://metacpan.org/pod/Specio::Declare" title="Specio::Declare" class="ellipsis">Specio::Declare</a></li>
  <li><a href="https://metacpan.org/pod/Specio::Exporter" title="Specio::Exporter" class="ellipsis">Specio::Exporter</a></li>
  <li><a href="https://metacpan.org/pod/Specio::Library::Builtins" title="Specio::Library::Builtins" class="ellipsis">Specio::Library::Builtins</a></li>
  <li><a href="https://metacpan.org/pod/Specio::Library::Numeric" title="Specio::Library::Numeric" class="ellipsis">Specio::Library::Numeric</a></li>
  <li><a href="https://metacpan.org/pod/Specio::Library::String" title="Specio::Library::String" class="ellipsis">Specio::Library::String</a></li>
  <li><a href="https://metacpan.org/pod/Specio::Subs" title="Specio::Subs" class="ellipsis">Specio::Subs</a></li>
  <li><a href="./Try::Tiny.html" title="Try::Tiny" class="ellipsis">Try::Tiny</a></li>
  <li><a href="https://metacpan.org/pod/XSLoader" title="XSLoader" class="ellipsis">XSLoader</a></li>
  <li><a href="https://metacpan.org/pod/integer" title="integer" class="ellipsis">integer</a></li>
  <li><a href="https://metacpan.org/pod/namespace::autoclean" title="namespace::autoclean" class="ellipsis">namespace::autoclean</a></li>
  <li><a href="https://metacpan.org/pod/overload" title="overload" class="ellipsis">overload</a></li>
  <li><a href="https://metacpan.org/pod/parent" title="parent" class="ellipsis">parent</a></li>
  <li><a href="https://metacpan.org/pod/strict" title="strict" class="ellipsis">strict</a></li>
  <li><a href="https://metacpan.org/pod/warnings" title="warnings" class="ellipsis">warnings</a></li>
  <li><a href="https://metacpan.org/pod/warnings::register" title="warnings::register" class="ellipsis">warnings::register</a></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/DateTime/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=DateTime">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=DateTime">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/DROLSKY/DateTime-1.65/view/lib/DateTime.pm">This version</a>
    </li>
    <li>
      <a href="DateTime.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/AYOUNG"><img src="https://www.gravatar.com/avatar/8d1e4946c288fbe87d1e0394f3e41b24?d=identicon&amp;s=20" title="AYOUNG" alt="AYOUNG"></a>
<a class="display-all" href="https://metacpan.org/author/LEEJO"><img src="https://www.gravatar.com/avatar/52d869b25e754a41a7bb8ac6db2f0be6?d=identicon&amp;s=20" title="LEEJO" alt="LEEJO"></a>
<a class="display-all" href="https://metacpan.org/author/FANY"><img src="https://www.gravatar.com/avatar/7bc0edaceda1cb0a5b56b844a5b406c2?d=identicon&amp;s=20" title="FANY" alt="FANY"></a>
<a class="display-all" href="https://metacpan.org/author/MMUSGROVE"><img src="https://www.gravatar.com/avatar/c8d0367f59978d30016ef08c7a60b961?d=identicon&amp;s=20" title="MMUSGROVE" alt="MMUSGROVE"></a>
<a class="display-all" href="https://metacpan.org/author/MIKEGRB"><img src="https://www.gravatar.com/avatar/db222feca6f1aa1c1df422d925b4e109?d=identicon&amp;s=20" title="MIKEGRB" alt="MIKEGRB"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/DateTime/plussers">115 PAUSE users</a>
</div>
<div>
    99 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 34 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
      data-cpan-author="BBENNETT"
      data-contrib-email="fiji@limey.net"
    >
      <a href="https://metacpan.org/author/BBENNETT" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/30fe10b17928a3fc13bc541d59064f01?d=identicon&amp;s=20" />
      Ben Bennett
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="CHANSEN"
      data-contrib-email="chansen@cpan.org"
    >
      <a href="https://metacpan.org/author/CHANSEN" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/8b5b6edf26acc698b27a585417bb9bb6?d=identicon&amp;s=20" />
      Christian Hansen
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="DMAKI"
      data-contrib-email="dmaki@cpan.org"
    >
      <a href="https://metacpan.org/author/DMAKI" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/666bb16f04467ef0c76edcbb05763ca0?d=identicon&amp;s=20" />
      Daisuke Maki
      </a>
    </li>
    <li class="contributor"
      data-contrib-email="grinnz@gmail.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Dan Book
    </li>
    <li class="contributor"
      data-cpan-author="DSTEWART"
      data-contrib-email="danielandrewstewart@gmail.com"
    >
      <a href="https://metacpan.org/author/DSTEWART" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/32becb2889b649213295721473fb5d3e?d=identicon&amp;s=20" />
      Dan Stewart
      </a>
    </li>
    <li class="contributor"
      data-contrib-email="david.dyck@checksum.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      David Dyck
    </li>
    <li class="contributor"
      data-cpan-author="DWHEELER"
      data-contrib-email="david@justatheory.com"
    >
      <a href="https://metacpan.org/author/DWHEELER" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/de2fe609ec8ae522883ea1235f1e8792?d=identicon&amp;s=20" />
      David E. Wheeler
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="BIGPRESH"
      data-contrib-email="davidp@preshweb.co.uk"
    >
      <a href="https://metacpan.org/author/BIGPRESH" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/66f9cc184db11ee7810f4bc2d029ec17?d=identicon&amp;s=20" />
      David Precious
      </a>
    </li>
    <li class="contributor"
      data-contrib-email="madcityzen@gmail.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Doug Bell
    </li>
    <li class="contributor"
      data-cpan-author="FGLOCK"
      data-contrib-email="fglock@gmail.com"
    >
      <a href="https://metacpan.org/author/FGLOCK" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/2c622ad013f36460f87c54eee7a50e0c?d=identicon&amp;s=20" />
      Flávio Soibelmann Glock
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="DAKKAR"
      data-contrib-email="gianni.ceccarelli@broadbean.com"
    >
      <a href="https://metacpan.org/author/DAKKAR" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/5d949b503c35e74c26ef8ecf649b886b?d=identicon&amp;s=20" />
      Gianni Ceccarelli
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="OSCHWALD"
      data-contrib-email="oschwald@gmail.com"
    >
      <a href="https://metacpan.org/author/OSCHWALD" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/2c092000b26ce71a7beb2161da998468?d=identicon&amp;s=20" />
      Gregory Oschwald
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="HAUKEX"
      data-contrib-email="haukex@zero-g.net"
    >
      <a href="https://metacpan.org/author/HAUKEX" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/72771ef2e59ebf9f0e665e987e8bdcf7?d=identicon&amp;s=20" />
      Hauke D
      </a>
    </li>
    <li class="contributor"
    >
      Iain Truskett &lt;deceased&gt;
    </li>
    <li class="contributor"
      data-cpan-author="RAZ"
      data-contrib-email="jraspass@gmail.com"
    >
      <a href="https://metacpan.org/author/RAZ" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/b9af2a54454e8f38c169be0c236670d6?d=identicon&amp;s=20" />
      James Raspass
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="JMAC"
      data-contrib-email="jmac@jmac.org"
    >
      <a href="https://metacpan.org/author/JMAC" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/1faa60b81ef6c289d2984a59bdbfcda4?d=identicon&amp;s=20" />
      Jason McIntosh
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="JHOBLITT"
      data-contrib-email="jhoblitt@cpan.org"
    >
      <a href="https://metacpan.org/author/JHOBLITT" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/689626e7008cc4a7b83c47bf865ce819?d=identicon&amp;s=20" />
      Joshua Hoblitt
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="ETHER"
      data-contrib-email="ether@cpan.org"
    >
      <a href="https://metacpan.org/author/ETHER" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/bdc5cd06679e732e262f6c1b450a0237?d=identicon&amp;s=20" />
      Karen Etheridge
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="MARKOV"
      data-contrib-email="mark@overmeer.net"
    >
      <a href="https://metacpan.org/author/MARKOV" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/18f0494979b7feef52388275080aaa34?d=identicon&amp;s=20" />
      Mark Overmeer
      </a>
    </li>
    <li class="contributor"
      data-contrib-email="mike@nrdvana.net"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Michael Conrad
    </li>
    <li class="contributor"
      data-contrib-email="mrdvt92@users.noreply.github.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Michael R. Davis
    </li>
    <li class="contributor"
      data-cpan-author="MANWAR"
      data-contrib-email="mohammad.anwar@yahoo.com"
    >
      <a href="https://metacpan.org/author/MANWAR" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/71c853edf567f3482e0e7f21d51e9df2?d=identicon&amp;s=20" />
      Mohammad S Anwar
      </a>
    </li>
    <li class="contributor"
      data-contrib-email="dracos@users.noreply.github.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      M Somerville
    </li>
    <li class="contributor"
      data-contrib-email="1nickt@users.noreply.github.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Nick Tonkin
    </li>
    <li class="contributor"
      data-contrib-email="olaf@wundersolutions.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Olaf Alders
    </li>
    <li class="contributor"
      data-contrib-email="curtis_ovid_poe@yahoo.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Ovid
    </li>
    <li class="contributor"
      data-contrib-email="paul@city-fan.org"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Paul Howarth
    </li>
    <li class="contributor"
      data-cpan-author="BOOK"
      data-contrib-email="book@cpan.org"
    >
      <a href="https://metacpan.org/author/BOOK" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/caceed5798ea9b855532b257de4686e8?d=identicon&amp;s=20" />
      Philippe Bruhat (BooK)
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="PRBRENAN"
      data-contrib-email="philiprbrenan@gmail.com"
    >
      <a href="https://metacpan.org/author/PRBRENAN" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/684bc3ed7de106aef0d7e43df1cc7a58?d=identicon&amp;s=20" />
      philip r brenan
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="RJBS"
      data-contrib-email="rjbs@cpan.org"
    >
      <a href="https://metacpan.org/author/RJBS" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/cec6b9b88295ead26c65f8747a76561b?d=identicon&amp;s=20" />
      Ricardo Signes
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="BOWEN"
      data-contrib-email="bowen@cpan.org"
    >
      <a href="https://metacpan.org/author/BOWEN" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/b5dfb9f40f1d76d2d6079bce2792fb3d?d=identicon&amp;s=20" />
      Richard Bowen
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="RKHILL"
      data-contrib-email="rkhill@cpan.org"
    >
      <a href="https://metacpan.org/author/RKHILL" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/0825042e277551eedc619c76c43d888a?d=identicon&amp;s=20" />
      Ron Hill
      </a>
    </li>
    <li class="contributor"
      data-contrib-email="github@illuminated.co.uk"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Sam Kington
    </li>
    <li class="contributor"
      data-contrib-email="viviparous@prc"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      viviparous
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/DROLSKY" class="author-name">Dave Rolsky</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/DateTime.pm&#39;" class="">
<option
  selected
  value="DROLSKY/DateTime-1.65"
>1.65
  (DROLSKY on 2023-11-06)</option>
<option
  
  value="DROLSKY/DateTime-1.64-TRIAL"
>1.64-TRIAL DEV
  (DROLSKY on 2023-10-29)</option>
<option
  
  value="DROLSKY/DateTime-1.63"
>1.63
  (DROLSKY on 2023-10-22)</option>
<option
  
  value="DROLSKY/DateTime-1.62-TRIAL"
>1.62-TRIAL DEV
  (DROLSKY on 2023-09-04)</option>
<option
  
  value="DROLSKY/DateTime-1.61-TRIAL"
>1.61-TRIAL DEV
  (DROLSKY on 2023-09-02)</option>
<option
  
  value="DROLSKY/DateTime-1.60-TRIAL"
>1.60-TRIAL DEV
  (DROLSKY on 2023-08-19)</option>
<option
  
  value="DROLSKY/DateTime-1.59"
>1.59
  (DROLSKY on 2022-10-23)</option>
<option
  
  value="DROLSKY/DateTime-1.58"
>1.58
  (DROLSKY on 2022-04-18)</option>
<option
  
  value="DROLSKY/DateTime-1.57"
>1.57
  (DROLSKY on 2022-03-03)</option>
<option
  
  value="DROLSKY/DateTime-1.56"
>1.56
  (DROLSKY on 2022-03-02)</option>
<option
  
  value="DROLSKY/DateTime-1.55"
>1.55
  (DROLSKY on 2021-12-23)</option>
<option
  
  value="DROLSKY/DateTime-1.54"
>1.54
  (DROLSKY on 2020-12-04)</option>
<option
  
  value="DROLSKY/DateTime-1.53"
>1.53
  (DROLSKY on 2020-11-09)</option>
<option
  
  value="DROLSKY/DateTime-1.52"
>1.52
  (DROLSKY on 2020-02-29)</option>
<option
  
  value="DROLSKY/DateTime-1.51"
>1.51
  (DROLSKY on 2019-04-21)</option>
<option
  
  value="DROLSKY/DateTime-1.50"
>1.50
  (DROLSKY on 2018-08-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="DROLSKY/DateTime-1.49"
>1.49
  (DROLSKY on 2018-05-20)</option>
<option
  
  value="DROLSKY/DateTime-1.48"
>1.48
  (DROLSKY on 2018-03-26)</option>
<option
  
  value="DROLSKY/DateTime-1.47"
>1.47
  (DROLSKY on 2018-03-25)</option>
<option
  
  value="DROLSKY/DateTime-1.46"
>1.46
  (DROLSKY on 2018-02-11)</option>
<option
  
  value="DROLSKY/DateTime-1.45"
>1.45
  (DROLSKY on 2017-12-29)</option>
<option
  
  value="DROLSKY/DateTime-1.44"
>1.44
  (DROLSKY on 2017-08-21)</option>
<option
  
  value="DROLSKY/DateTime-1.43"
>1.43
  (DROLSKY on 2017-05-29)</option>
<option
  
  value="DROLSKY/DateTime-1.42"
>1.42
  (DROLSKY on 2016-12-25)</option>
<option
  
  value="DROLSKY/DateTime-1.41"
>1.41
  (DROLSKY on 2016-11-16)</option>
<option
  
  value="DROLSKY/DateTime-1.40"
>1.40
  (DROLSKY on 2016-11-12)</option>
<option
  
  value="DROLSKY/DateTime-1.39"
>1.39
  (DROLSKY on 2016-09-18)</option>
<option
  
  value="DROLSKY/DateTime-1.38"
>1.38
  (DROLSKY on 2016-09-16)</option>
<option
  
  value="DROLSKY/DateTime-1.37-TRIAL"
>1.37-TRIAL DEV
  (DROLSKY on 2016-08-14)</option>
<option
  
  value="DROLSKY/DateTime-1.36"
>1.36
  (DROLSKY on 2016-08-06)</option>
<option
  
  value="DROLSKY/DateTime-1.35"
>1.35
  (DROLSKY on 2016-08-06)</option>
<option
  
  value="DROLSKY/DateTime-1.34"
>1.34
  (DROLSKY on 2016-07-06)</option>
<option
  
  value="DROLSKY/DateTime-1.33"
>1.33
  (DROLSKY on 2016-06-29)</option>
<option
  
  value="DROLSKY/DateTime-1.32"
>1.32
  (DROLSKY on 2016-06-29)</option>
<option
  
  value="DROLSKY/DateTime-1.31-TRIAL"
>1.31-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.30-TRIAL"
>1.30-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.29-TRIAL"
>1.29-TRIAL DEV
  (DROLSKY on 2016-06-18)</option>
<option
  
  value="DROLSKY/DateTime-1.28"
>1.28
  (DROLSKY on 2016-05-21)</option>
<option
  
  value="DROLSKY/DateTime-1.27"
>1.27
  (DROLSKY on 2016-05-13)</option>
<option
  
  value="DROLSKY/DateTime-1.26"
>1.26
  (DROLSKY on 2016-03-21)</option>
<option
  
  value="DROLSKY/DateTime-1.25"
>1.25
  (DROLSKY on 2016-03-06)</option>
<option
  
  value="DROLSKY/DateTime-1.24"
>1.24
  (DROLSKY on 2016-02-29)</option>
<option
  
  value="DROLSKY/DateTime-1.23"
>1.23
  (DROLSKY on 2016-02-28)</option>
<option
  
  value="DROLSKY/DateTime-1.22-TRIAL"
>1.22-TRIAL DEV
  (DROLSKY on 2016-02-21)</option>
<option
  
  value="DROLSKY/DateTime-1.21"
>1.21
  (DROLSKY on 2015-09-30)</option>
<option
  
  value="DROLSKY/DateTime-1.20"
>1.20
  (DROLSKY on 2015-07-01)</option>
<option
  
  value="DROLSKY/DateTime-1.19"
>1.19
  (DROLSKY on 2015-05-31)</option>
<option
  
  value="DROLSKY/DateTime-1.18"
>1.18
  (DROLSKY on 2015-01-05)</option>
<option
  
  value="DROLSKY/DateTime-1.17"
>1.17
  (DROLSKY on 2015-01-05)</option>
<option
  
  value="DROLSKY/DateTime-1.16-TRIAL"
>1.16-TRIAL DEV
  (DROLSKY on 2015-01-04)</option>
<option
  
  value="DROLSKY/DateTime-1.15-TRIAL"
>1.15-TRIAL DEV
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.14"
>1.14
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.13"
>1.13
  (DROLSKY on 2015-01-03)</option>
<option
  
  value="DROLSKY/DateTime-1.12"
>1.12
  (DROLSKY on 2014-08-31)</option>
<option
  
  value="DROLSKY/DateTime-1.11"
>1.11
  (DROLSKY on 2014-08-31)</option>
<option
  
  value="DROLSKY/DateTime-1.10"
>1.10
  (DROLSKY on 2014-05-05)</option>
<option
  
  value="DROLSKY/DateTime-1.09"
>1.09
  (DROLSKY on 2014-05-03)</option>
<option
  
  value="DROLSKY/DateTime-1.08"
>1.08
  (DROLSKY on 2014-03-11)</option>
<option
  
  value="DROLSKY/DateTime-1.07"
>1.07
  (DROLSKY on 2014-02-07)</option>
<option
  
  value="DROLSKY/DateTime-1.06"
>1.06
  (DROLSKY on 2013-12-31)</option>
<option
  
  value="DROLSKY/DateTime-1.05"
>1.05
  (DROLSKY on 2013-12-22)</option>
<option
  
  value="DROLSKY/DateTime-1.04"
>1.04
  (DROLSKY on 2013-12-07)</option>
<option
  
  value="DROLSKY/DateTime-1.03"
>1.03
  (DROLSKY on 2013-04-17)</option>
<option
  
  value="DROLSKY/DateTime-1.02"
>1.02
  (DROLSKY on 2013-04-16)</option>
<option
  
  value="DROLSKY/DateTime-1.01"
>1.01
  (DROLSKY on 2013-04-01)</option>
<option
  
  value="DROLSKY/DateTime-1.00"
>1.00
  (DROLSKY on 2013-03-31)</option>
<option
  
  value="DROLSKY/DateTime-0.78"
>0.78
  (DROLSKY on 2012-11-16)</option>
<option
  
  value="DROLSKY/DateTime-0.77"
>0.77
  (DROLSKY on 2012-09-25)</option>
<option
  
  value="DROLSKY/DateTime-0.76"
>0.76
  (DROLSKY on 2012-07-01)</option>
<option
  
  value="DROLSKY/DateTime-0.75"
>0.75
  (DROLSKY on 2012-06-11)</option>
<option
  
  value="DROLSKY/DateTime-0.74"
>0.74
  (DROLSKY on 2012-03-22)</option>
<option
  
  value="DROLSKY/DateTime-0.73"
>0.73
  (DROLSKY on 2012-03-17)</option>
<option
  
  value="DROLSKY/DateTime-0.72"
>0.72
  (DROLSKY on 2012-01-05)</option>
<option
  
  value="DROLSKY/DateTime-0.71"
>0.71
  (DROLSKY on 2012-01-05)</option>
<option
  
  value="DROLSKY/DateTime-0.70"
>0.70
  (DROLSKY on 2011-05-09)</option>
<option
  
  value="DROLSKY/DateTime-0.69"
>0.69
  (DROLSKY on 2011-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.68"
>0.68
  (DROLSKY on 2011-04-25)</option>
<option
  
  value="DROLSKY/DateTime-0.67"
>0.67
  (DROLSKY on 2011-04-24)</option>
<option
  
  value="DROLSKY/DateTime-0.66"
>0.66
  (DROLSKY on 2010-11-26)</option>
<option
  
  value="DROLSKY/DateTime-0.65"
>0.65
  (DROLSKY on 2010-10-26)</option>
<option
  
  value="DROLSKY/DateTime-0.64"
>0.64
  (DROLSKY on 2010-10-26)</option>
<option
  
  value="DROLSKY/DateTime-0.63"
>0.63
  (DROLSKY on 2010-09-25)</option>
<option
  
  value="DROLSKY/DateTime-0.62"
>0.62
  (DROLSKY on 2010-09-23)</option>
<option
  
  value="DROLSKY/DateTime-0.61"
>0.61
  (DROLSKY on 2010-07-17)</option>
<option
  
  value="DROLSKY/DateTime-0.60"
>0.60
  (DROLSKY on 2010-07-03)</option>
<option
  
  value="DROLSKY/DateTime-0.59"
>0.59
  (DROLSKY on 2010-06-29)</option>
<option
  
  value="DROLSKY/DateTime-0.58"
>0.58
  (DROLSKY on 2010-06-28)</option>
<option
  
  value="DROLSKY/DateTime-0.57"
>0.57
  (DROLSKY on 2010-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.56"
>0.56
  (DROLSKY on 2010-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.55"
>0.55
  (DROLSKY on 2010-03-16)</option>
<option
  
  value="DROLSKY/DateTime-0.54"
>0.54
  (DROLSKY on 2010-03-14)</option>
<option
  
  value="DROLSKY/DateTime-0.53"
>0.53
  (DROLSKY on 2009-12-06)</option>
<option
  
  value="DROLSKY/DateTime-0.52"
>0.52
  (DROLSKY on 2009-12-05)</option>
<option
  
  value="DROLSKY/DateTime-0.51"
>0.51
  (DROLSKY on 2009-11-01)</option>
<option
  
  value="DROLSKY/DateTime-0.50"
>0.50
  (DROLSKY on 2009-05-11)</option>
<option
  
  value="DROLSKY/DateTime-0.49"
>0.49
  (DROLSKY on 2009-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.48"
>0.48
  (DROLSKY on 2009-05-04)</option>
<option
  
  value="DROLSKY/DateTime-0.47"
>0.47
  (DROLSKY on 2009-03-01)</option>
<option
  
  value="DROLSKY/DateTime-0.46"
>0.46
  (DROLSKY on 2009-02-28)</option>
<option
  
  value="DROLSKY/DateTime-0.4501"
>0.4501
  (DROLSKY on 2008-11-25)</option>
<option
  
  value="DROLSKY/DateTime-0.45"
>0.45
  (DROLSKY on 2008-11-12)</option>
<option
  
  value="DROLSKY/DateTime-0.4401"
>0.4401
  (DROLSKY on 2008-11-03)</option>
<option
  
  value="DROLSKY/DateTime-0.44"
>0.44
  (DROLSKY on 2008-11-01)</option>
<option
  
  value="DROLSKY/DateTime-0.4305"
>0.4305
  (DROLSKY on 2008-10-03)</option>
<option
  
  value="DROLSKY/DateTime-0.4304"
>0.4304
  (DROLSKY on 2008-07-13)</option>
<option
  
  value="DROLSKY/DateTime-0.4303"
>0.4303
  (DROLSKY on 2008-07-12)</option>
<option
  
  value="DROLSKY/DateTime-0.4302"
>0.4302
  (DROLSKY on 2008-05-20)</option>
<option
  
  value="DROLSKY/DateTime-0.4301"
>0.4301
  (DROLSKY on 2008-05-18)</option>
<option
  
  value="DROLSKY/DateTime-0.43"
>0.43
  (DROLSKY on 2008-05-18)</option>
<option
  
  value="DROLSKY/DateTime-0.42"
>0.42
  (DROLSKY on 2008-02-29)</option>
<option
  
  value="DROLSKY/DateTime-0.41"
>0.41
  (DROLSKY on 2007-09-10)</option>
<option
  
  value="DROLSKY/DateTime-0.40"
>0.40
  (DROLSKY on 2007-08-30)</option>
<option
  
  value="DROLSKY/DateTime-0.39"
>0.39
  (DROLSKY on 2007-07-17)</option>
<option
  
  value="DROLSKY/DateTime-0.38"
>0.38
  (DROLSKY on 2007-07-01)</option>
<option
  
  value="DROLSKY/DateTime-0.37"
>0.37
  (DROLSKY on 2007-03-30)</option>
<option
  
  value="DROLSKY/DateTime-0.36"
>0.36
  (DROLSKY on 2007-01-18)</option>
<option
  
  value="DROLSKY/DateTime-0.35"
>0.35
  (DROLSKY on 2006-10-22)</option>
<option
  
  value="DROLSKY/DateTime-0.34"
>0.34
  (DROLSKY on 2006-08-11)</option>
<option
  
  value="DROLSKY/DateTime-0.33"
>0.33
  (DROLSKY on 2006-08-09)</option>
<option
  
  value="DROLSKY/DateTime-0.32"
>0.32
  (DROLSKY on 2006-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.31"
>0.31
  (DROLSKY on 2006-05-21)</option>
<option
  
  value="DROLSKY/DateTime-0.30"
>0.30
  (DROLSKY on 2005-12-22)</option>
<option
  
  value="DROLSKY/DateTime-0.2901"
>0.2901
  (DROLSKY on 2005-07-04)</option>
<option
  
  value="DROLSKY/DateTime-0.29"
>0.29
  (DROLSKY on 2005-06-03)</option>
<option
  
  value="DROLSKY/DateTime-0.28"
>0.28
  (DROLSKY on 2005-02-28)</option>
<option
  
  value="DROLSKY/DateTime-0.27"
>0.27
  (DROLSKY on 2005-01-31)</option>
<option
  
  value="DROLSKY/DateTime-0.26"
>0.26
  (DROLSKY on 2005-01-27)</option>
<option
  
  value="DROLSKY/DateTime-0.25"
>0.25
  (DROLSKY on 2005-01-11)</option>
<option
  
  value="DROLSKY/DateTime-0.24"
>0.24
  (DROLSKY on 2004-12-10)</option>
<option
  
  value="DROLSKY/DateTime-0.23"
>0.23
  (DROLSKY on 2004-12-09)</option>
<option
  
  value="DROLSKY/DateTime-0.22"
>0.22
  (DROLSKY on 2004-07-23)</option>
<option
  
  value="DROLSKY/DateTime-0.2101"
>0.2101
  (DROLSKY on 2004-06-10)</option>
<option
  
  value="DROLSKY/DateTime-0.21"
>0.21
  (DROLSKY on 2004-03-28)</option>
<option
  
  value="DROLSKY/DateTime-0.20"
>0.20
  (DROLSKY on 2004-02-12)</option>
<option
  
  value="DROLSKY/DateTime-0.1901"
>0.1901
  (DROLSKY on 2004-01-07)</option>
<option
  
  value="DROLSKY/DateTime-0.19"
>0.19
  (DROLSKY on 2003-12-02)</option>
<option
  
  value="DROLSKY/DateTime-0.18"
>0.18
  (DROLSKY on 2003-10-27)</option>
<option
  
  value="DROLSKY/DateTime-0.1705"
>0.1705
  (DROLSKY on 2003-10-07)</option>
<option
  
  value="DROLSKY/DateTime-0.1704"
>0.1704
  (DROLSKY on 2003-10-07)</option>
<option
  
  value="DROLSKY/DateTime-0.1703"
>0.1703
  (DROLSKY on 2003-09-22)</option>
<option
  
  value="DROLSKY/DateTime-0.1702"
>0.1702
  (DROLSKY on 2003-09-18)</option>
<option
  
  value="DROLSKY/DateTime-0.1701"
>0.1701
  (DROLSKY on 2003-09-15)</option>
<option
  
  value="DROLSKY/DateTime-0.17"
>0.17
  (DROLSKY on 2003-08-29)</option>
<option
  
  value="DROLSKY/DateTime-0.1601"
>0.1601
  (DROLSKY on 2003-08-07)</option>
<option
  
  value="DROLSKY/DateTime-0.16"
>0.16
  (DROLSKY on 2003-08-06)</option>
<option
  
  value="DROLSKY/DateTime-0.1503"
>0.1503
  (DROLSKY on 2003-07-31)</option>
<option
  
  value="DROLSKY/DateTime-0.1502"
>0.1502
  (DROLSKY on 2003-07-31)</option>
<option
  
  value="DROLSKY/DateTime-0.1501"
>0.1501
  (DROLSKY on 2003-07-30)</option>
<option
  
  value="DROLSKY/DateTime-0.15"
>0.15
  (DROLSKY on 2003-07-29)</option>
<option
  
  value="DROLSKY/DateTime-0.1402"
>0.1402
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.1401"
>0.1401
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.14"
>0.14
  (DROLSKY on 2003-07-24)</option>
<option
  
  value="DROLSKY/DateTime-0.13"
>0.13
  (DROLSKY on 2003-06-26)</option>
<option
  
  value="DROLSKY/DateTime-0.12"
>0.12
  (DROLSKY on 2003-05-05)</option>
<option
  
  value="DROLSKY/DateTime-0.11"
>0.11
  (DROLSKY on 2003-05-03)</option>
<option
  
  value="DROLSKY/DateTime-0.10"
>0.10
  (DROLSKY on 2003-04-19)</option>
<option
  
  value="PGOLLUCCI/DateTime-0.01"
>0.01
  (PGOLLUCCI on 2003-04-17)</option>
<option
  
  value="DROLSKY/DateTime-0.09"
>0.09
  (DROLSKY on 2003-04-05)</option>
<option
  
  value="DROLSKY/DateTime-0.08"
>0.08
  (DROLSKY on 2003-03-21)</option>
<option
  
  value="DROLSKY/DateTime-0.07"
>0.07
  (DROLSKY on 2003-02-27)</option>
<option
  
  value="DROLSKY/DateTime-0.06"
>0.06
  (DROLSKY on 2003-02-16)</option>
<option
  
  value="DROLSKY/DateTime-0.05"
>0.05
  (DROLSKY on 2003-02-14)</option>
<option
  
  value="DROLSKY/DateTime-0.03"
>0.03
  (DROLSKY on 2003-02-09)</option>
<option
  
  value="DROLSKY/DateTime-0.02"
>0.02
  (DROLSKY on 2003-02-09)</option>
<option
  
  value="DROLSKY/DateTime-0.01_00"
>0.01_00 DEV
  (DROLSKY on 2003-02-04)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/DateTime">DateTime-1.65</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage four &#10;
          • 1153 direct dependents &#10;          • 3694 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="DateTime-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="DateTime-1.65">
    <input type="hidden" name="author" value="DROLSKY">
    <input type="hidden" name="distribution" value="DateTime">
    <button type="submit" class="favorite highlight"><span>214</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="DateTime.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>214</span> ++</a>
</div>
   / <span>DateTime</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="DateTime.html#NAME">NAME</a></li>
  <li><a href="DateTime.html#VERSION">VERSION</a></li>
  <li><a href="DateTime.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="DateTime.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="DateTime.html#USAGE">USAGE</a>
    <ul>
      <li><a href="DateTime.html#0-based-Versus-1-based-Numbers">0-based Versus 1-based Numbers</a></li>
      <li><a href="DateTime.html#Error-Handling">Error Handling</a></li>
      <li><a href="DateTime.html#Locales">Locales</a></li>
      <li><a href="DateTime.html#Floating-DateTimes">Floating DateTimes</a></li>
      <li><a href="DateTime.html#Math">Math</a></li>
      <li><a href="DateTime.html#Determining-the-Local-Time-Zone-Can-Be-Slow">Determining the Local Time Zone Can Be Slow</a></li>
      <li><a href="DateTime.html#Far-Future-DST">Far Future DST</a></li>
      <li><a href="DateTime.html#Globally-Setting-a-Default-Time-Zone">Globally Setting a Default Time Zone</a></li>
      <li><a href="DateTime.html#Upper-and-Lower-Bounds">Upper and Lower Bounds</a></li>
    </ul>
  </li>
  <li><a href="DateTime.html#METHODS">METHODS</a>
    <ul>
      <li><a href="DateTime.html#Constructors">Constructors</a>
        <ul>
          <li><a href="DateTime.html#Warnings">Warnings</a></li>
          <li><a href="DateTime.html#DateTime-%3Enew(-...-)">DateTime-&gt;new( ... )</a>
            <ul>
              <li><a href="DateTime.html#Parsing-Dates">Parsing Dates</a></li>
              <li><a href="DateTime.html#Ambiguous-Local-Times">Ambiguous Local Times</a></li>
              <li><a href="DateTime.html#Invalid-Local-Times">Invalid Local Times</a></li>
            </ul>
          </li>
          <li><a href="DateTime.html#DateTime-%3Efrom_epoch(-epoch-=%3E-$epoch,-...-)">DateTime-&gt;from_epoch( epoch =&gt; $epoch, ... )</a></li>
          <li><a href="DateTime.html#DateTime-%3Enow(-...-)">DateTime-&gt;now( ... )</a></li>
          <li><a href="DateTime.html#DateTime-%3Etoday(-...-)">DateTime-&gt;today( ... )</a></li>
          <li><a href="DateTime.html#DateTime-%3Elast_day_of_month(-...-)">DateTime-&gt;last_day_of_month( ... )</a></li>
          <li><a href="DateTime.html#DateTime-%3Efrom_day_of_year(-...-)">DateTime-&gt;from_day_of_year( ... )</a></li>
          <li><a href="DateTime.html#DateTime-%3Efrom_object(-object-=%3E-$object,-...-)">DateTime-&gt;from_object( object =&gt; $object, ... )</a></li>
          <li><a href="DateTime.html#$dt-%3Eclone">$dt-&gt;clone</a></li>
        </ul>
      </li>
      <li><a href="DateTime.html#%22Get%22-Methods">&quot;Get&quot; Methods</a>
        <ul>
          <li><a href="DateTime.html#$dt-%3Eyear">$dt-&gt;year</a></li>
          <li><a href="DateTime.html#$dt-%3Ece_year">$dt-&gt;ce_year</a></li>
          <li><a href="DateTime.html#$dt-%3Eera_name">$dt-&gt;era_name</a></li>
          <li><a href="DateTime.html#$dt-%3Eera_abbr">$dt-&gt;era_abbr</a></li>
          <li><a href="DateTime.html#$dt-%3Echristian_era">$dt-&gt;christian_era</a></li>
          <li><a href="DateTime.html#$dt-%3Esecular_era">$dt-&gt;secular_era</a></li>
          <li><a href="DateTime.html#$dt-%3Eyear_with_era">$dt-&gt;year_with_era</a></li>
          <li><a href="DateTime.html#$dt-%3Eyear_with_christian_era">$dt-&gt;year_with_christian_era</a></li>
          <li><a href="DateTime.html#$dt-%3Eyear_with_secular_era">$dt-&gt;year_with_secular_era</a></li>
          <li><a href="DateTime.html#$dt-%3Emonth">$dt-&gt;month</a></li>
          <li><a href="DateTime.html#$dt-%3Emonth_name">$dt-&gt;month_name</a></li>
          <li><a href="DateTime.html#$dt-%3Emonth_abbr">$dt-&gt;month_abbr</a></li>
          <li><a href="DateTime.html#$dt-%3Eday">$dt-&gt;day</a></li>
          <li><a href="DateTime.html#$dt-%3Eday_of_week">$dt-&gt;day_of_week</a></li>
          <li><a href="DateTime.html#$dt-%3Elocal_day_of_week">$dt-&gt;local_day_of_week</a></li>
          <li><a href="DateTime.html#$dt-%3Eday_name">$dt-&gt;day_name</a></li>
          <li><a href="DateTime.html#$dt-%3Eday_abbr">$dt-&gt;day_abbr</a></li>
          <li><a href="DateTime.html#$dt-%3Eday_of_year">$dt-&gt;day_of_year</a></li>
          <li><a href="DateTime.html#$dt-%3Equarter">$dt-&gt;quarter</a></li>
          <li><a href="DateTime.html#$dt-%3Equarter_name">$dt-&gt;quarter_name</a></li>
          <li><a href="DateTime.html#$dt-%3Equarter_abbr">$dt-&gt;quarter_abbr</a></li>
          <li><a href="DateTime.html#$dt-%3Eday_of_quarter">$dt-&gt;day_of_quarter</a></li>
          <li><a href="DateTime.html#$dt-%3Eweekday_of_month">$dt-&gt;weekday_of_month</a></li>
          <li><a href="DateTime.html#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...)">$dt-&gt;ymd($optional_separator), $dt-&gt;mdy(...), $dt-&gt;dmy(...)</a></li>
          <li><a href="DateTime.html#$dt-%3Ehour">$dt-&gt;hour</a></li>
          <li><a href="DateTime.html#$dt-%3Ehour_1">$dt-&gt;hour_1</a></li>
          <li><a href="DateTime.html#$dt-%3Ehour_12">$dt-&gt;hour_12</a></li>
          <li><a href="DateTime.html#$dt-%3Ehour_12_0">$dt-&gt;hour_12_0</a></li>
          <li><a href="DateTime.html#$dt-%3Eam_or_pm">$dt-&gt;am_or_pm</a></li>
          <li><a href="DateTime.html#$dt-%3Eminute">$dt-&gt;minute</a></li>
          <li><a href="DateTime.html#$dt-%3Esecond">$dt-&gt;second</a></li>
          <li><a href="DateTime.html#$dt-%3Efractional_second">$dt-&gt;fractional_second</a></li>
          <li><a href="DateTime.html#$dt-%3Emillisecond">$dt-&gt;millisecond</a></li>
          <li><a href="DateTime.html#$dt-%3Emicrosecond">$dt-&gt;microsecond</a></li>
          <li><a href="DateTime.html#$dt-%3Enanosecond">$dt-&gt;nanosecond</a></li>
          <li><a href="DateTime.html#$dt-%3Ehms($optional_separator)">$dt-&gt;hms($optional_separator)</a></li>
          <li><a href="DateTime.html#$dt-%3Edatetime($optional_separator)">$dt-&gt;datetime($optional_separator)</a></li>
          <li><a href="DateTime.html#$dt-%3Erfc3339">$dt-&gt;rfc3339</a></li>
          <li><a href="DateTime.html#$dt-%3Estringify">$dt-&gt;stringify</a></li>
          <li><a href="DateTime.html#$dt-%3Eis_leap_year">$dt-&gt;is_leap_year</a></li>
          <li><a href="DateTime.html#$dt-%3Eis_last_day_of_month">$dt-&gt;is_last_day_of_month</a></li>
          <li><a href="DateTime.html#$dt-%3Eis_last_day_of_quarter">$dt-&gt;is_last_day_of_quarter</a></li>
          <li><a href="DateTime.html#$dt-%3Eis_last_day_of_year">$dt-&gt;is_last_day_of_year</a></li>
          <li><a href="DateTime.html#$dt-%3Emonth_length">$dt-&gt;month_length</a></li>
          <li><a href="DateTime.html#$dt-%3Equarter_length">$dt-&gt;quarter_length</a></li>
          <li><a href="DateTime.html#$dt-%3Eyear_length">$dt-&gt;year_length</a></li>
          <li><a href="DateTime.html#$dt-%3Eweek">$dt-&gt;week</a></li>
          <li><a href="DateTime.html#$dt-%3Eweek_year">$dt-&gt;week_year</a></li>
          <li><a href="DateTime.html#$dt-%3Eweek_number">$dt-&gt;week_number</a></li>
          <li><a href="DateTime.html#$dt-%3Eweek_of_month">$dt-&gt;week_of_month</a></li>
          <li><a href="DateTime.html#$dt-%3Ejd,-$dt-%3Emjd">$dt-&gt;jd, $dt-&gt;mjd</a></li>
          <li><a href="DateTime.html#$dt-%3Etime_zone">$dt-&gt;time_zone</a></li>
          <li><a href="DateTime.html#$dt-%3Eoffset">$dt-&gt;offset</a></li>
          <li><a href="DateTime.html#$dt-%3Eis_dst">$dt-&gt;is_dst</a></li>
          <li><a href="DateTime.html#$dt-%3Etime_zone_long_name">$dt-&gt;time_zone_long_name</a></li>
          <li><a href="DateTime.html#$dt-%3Etime_zone_short_name">$dt-&gt;time_zone_short_name</a></li>
          <li><a href="DateTime.html#$dt-%3Estrftime(-$format,-...-)">$dt-&gt;strftime( $format, ... )</a></li>
          <li><a href="DateTime.html#$dt-%3Eformat_cldr(-$format,-...-)">$dt-&gt;format_cldr( $format, ... )</a></li>
          <li><a href="DateTime.html#$dt-%3Eepoch">$dt-&gt;epoch</a></li>
          <li><a href="DateTime.html#$dt-%3Ehires_epoch">$dt-&gt;hires_epoch</a></li>
          <li><a href="DateTime.html#$dt-%3Eis_finite,-$dt-%3Eis_infinite">$dt-&gt;is_finite, $dt-&gt;is_infinite</a></li>
          <li><a href="DateTime.html#$dt-%3Eutc_rd_values">$dt-&gt;utc_rd_values</a></li>
          <li><a href="DateTime.html#$dt-%3Elocal_rd_values">$dt-&gt;local_rd_values</a></li>
          <li><a href="DateTime.html#$dt-%3Eleap_seconds">$dt-&gt;leap_seconds</a></li>
          <li><a href="DateTime.html#$dt-%3Eutc_rd_as_seconds">$dt-&gt;utc_rd_as_seconds</a></li>
          <li><a href="DateTime.html#$dt-%3Elocale">$dt-&gt;locale</a></li>
          <li><a href="DateTime.html#$dt-%3Eformatter">$dt-&gt;formatter</a></li>
        </ul>
      </li>
      <li><a href="DateTime.html#%22Set%22-Methods">&quot;Set&quot; Methods</a>
        <ul>
          <li><a href="DateTime.html#$dt-%3Eset(-..-)">$dt-&gt;set( .. )</a></li>
          <li><a href="DateTime.html#$dt-%3Eset_year,-$dt-%3Eset_month,-etc.">$dt-&gt;set_year, $dt-&gt;set_month, etc.</a></li>
          <li><a href="DateTime.html#$dt-%3Etruncate(-to-=%3E-...-)">$dt-&gt;truncate( to =&gt; ... )</a></li>
          <li><a href="DateTime.html#$dt-%3Eset_locale($locale)">$dt-&gt;set_locale($locale)</a></li>
          <li><a href="DateTime.html#$dt-%3Eset_time_zone($tz)">$dt-&gt;set_time_zone($tz)</a></li>
          <li><a href="DateTime.html#$dt-%3Eset_formatter($formatter)">$dt-&gt;set_formatter($formatter)</a></li>
        </ul>
      </li>
      <li><a href="DateTime.html#Math-Methods">Math Methods</a>
        <ul>
          <li><a href="DateTime.html#$dt-%3Eduration_class">$dt-&gt;duration_class</a></li>
          <li><a href="DateTime.html#$dt-%3Eadd_duration($duration_object)">$dt-&gt;add_duration($duration_object)</a></li>
          <li><a href="DateTime.html#$dt-%3Eadd(-parameters-for-DateTime::Duration-)">$dt-&gt;add( parameters for DateTime::Duration )</a></li>
          <li><a href="DateTime.html#$dt-%3Eadd($duration_object)">$dt-&gt;add($duration_object)</a></li>
          <li><a href="DateTime.html#$dt-%3Esubtract_duration($duration_object)">$dt-&gt;subtract_duration($duration_object)</a></li>
          <li><a href="DateTime.html#$dt-%3Esubtract(-DateTime::Duration-%3Enew-parameters-)">$dt-&gt;subtract( DateTime::Duration-&gt;new parameters )</a></li>
          <li><a href="DateTime.html#$dt-%3Esubtract($duration_object)">$dt-&gt;subtract($duration_object)</a></li>
          <li><a href="DateTime.html#$dt-%3Esubtract_datetime($datetime)">$dt-&gt;subtract_datetime($datetime)</a></li>
          <li><a href="DateTime.html#$dt-%3Edelta_md($datetime),-$dt-%3Edelta_days($datetime)">$dt-&gt;delta_md($datetime), $dt-&gt;delta_days($datetime)</a></li>
          <li><a href="DateTime.html#$dt-%3Edelta_ms($datetime)">$dt-&gt;delta_ms($datetime)</a></li>
          <li><a href="DateTime.html#$dt-%3Esubtract_datetime_absolute($datetime)">$dt-&gt;subtract_datetime_absolute($datetime)</a></li>
          <li><a href="DateTime.html#$dt-%3Eis_between(-$lower,-$upper-)">$dt-&gt;is_between( $lower, $upper )</a></li>
        </ul>
      </li>
      <li><a href="DateTime.html#Class-Methods">Class Methods</a>
        <ul>
          <li><a href="DateTime.html#DateTime-%3EDefaultLocale($locale)">DateTime-&gt;DefaultLocale($locale)</a></li>
          <li><a href="DateTime.html#DateTime-%3Ecompare(-$dt1,-$dt2-),-DateTime-%3Ecompare_ignore_floating(-$dt1,-$dt2-)">DateTime-&gt;compare( $dt1, $dt2 ), DateTime-&gt;compare_ignore_floating( $dt1, $dt2 )</a></li>
        </ul>
      </li>
      <li><a href="DateTime.html#Testing-Code-That-Uses-DateTime">Testing Code That Uses DateTime</a></li>
      <li><a href="DateTime.html#How-DateTime-Math-Works">How DateTime Math Works</a>
        <ul>
          <li><a href="DateTime.html#Making-Things-Simple">Making Things Simple</a></li>
          <li><a href="DateTime.html#Adding-a-Duration-to-a-DateTime">Adding a Duration to a DateTime</a></li>
          <li><a href="DateTime.html#DateTime-Subtraction">DateTime Subtraction</a></li>
          <li><a href="DateTime.html#Reversibility">Reversibility</a></li>
          <li><a href="DateTime.html#Leap-Seconds-and-Date-Math">Leap Seconds and Date Math</a></li>
          <li><a href="DateTime.html#Local-vs.-UTC-and-24-hours-vs.-1-day">Local vs. UTC and 24 hours vs. 1 day</a></li>
        </ul>
      </li>
      <li><a href="DateTime.html#Overloading">Overloading</a></li>
      <li><a href="DateTime.html#Formatters-And-Stringification">Formatters And Stringification</a></li>
      <li><a href="DateTime.html#CLDR-Patterns">CLDR Patterns</a>
        <ul>
          <li><a href="DateTime.html#CLDR-%22Available-Formats%22">CLDR &quot;Available Formats&quot;</a></li>
        </ul>
      </li>
      <li><a href="DateTime.html#strftime-Patterns">strftime Patterns</a></li>
      <li><a href="DateTime.html#DateTime-and-Storable">DateTime and Storable</a></li>
    </ul>
  </li>
  <li><a href="DateTime.html#DEVELOPMENT-TOOLS">DEVELOPMENT TOOLS</a></li>
  <li><a href="DateTime.html#THE-DATETIME-PROJECT-ECOSYSTEM">THE DATETIME PROJECT ECOSYSTEM</a>
    <ul>
      <li><a href="DateTime.html#DateTime::Set">DateTime::Set</a></li>
      <li><a href="DateTime.html#Format-Modules">Format Modules</a></li>
      <li><a href="DateTime.html#Calendar-Modules">Calendar Modules</a></li>
      <li><a href="DateTime.html#Event-Modules">Event Modules</a></li>
      <li><a href="DateTime.html#Others">Others</a></li>
    </ul>
  </li>
  <li><a href="DateTime.html#KNOWN-BUGS">KNOWN BUGS</a></li>
  <li><a href="DateTime.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="DateTime.html#SUPPORT">SUPPORT</a></li>
  <li><a href="DateTime.html#SOURCE">SOURCE</a></li>
  <li><a href="DateTime.html#DONATIONS">DONATIONS</a></li>
  <li><a href="DateTime.html#AUTHOR">AUTHOR</a></li>
  <li><a href="DateTime.html#CONTRIBUTORS">CONTRIBUTORS</a></li>
  <li><a href="DateTime.html#COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>DateTime - A date and time object for Perl</p>

<h1 id="VERSION">VERSION</h1>

<p>version 1.65</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    use DateTime;

    $dt = DateTime-&gt;new(
        year       =&gt; 1964,
        month      =&gt; 10,
        day        =&gt; 16,
        hour       =&gt; 16,
        minute     =&gt; 12,
        second     =&gt; 47,
        nanosecond =&gt; 500000000,
        time_zone  =&gt; &#39;Asia/Taipei&#39;,
    );

    $dt = DateTime-&gt;from_epoch( epoch =&gt; $epoch );
    $dt = DateTime-&gt;now;    # same as ( epoch =&gt; time )

    $year  = $dt-&gt;year;
    $month = $dt-&gt;month;        # 1-12

    $day = $dt-&gt;day;            # 1-31

    $dow = $dt-&gt;day_of_week;    # 1-7 (Monday is 1)

    $hour   = $dt-&gt;hour;        # 0-23
    $minute = $dt-&gt;minute;      # 0-59

    $second = $dt-&gt;second;      # 0-61 (leap seconds!)

    $doy = $dt-&gt;day_of_year;    # 1-366 (leap years)

    $doq = $dt-&gt;day_of_quarter; # 1..

    $qtr = $dt-&gt;quarter;        # 1-4

    # all of the start-at-1 methods above have corresponding start-at-0
    # methods, such as $dt-&gt;day_of_month_0, $dt-&gt;month_0 and so on

    $ymd = $dt-&gt;ymd;         # 2002-12-06
    $ymd = $dt-&gt;ymd(&#39;/&#39;);    # 2002/12/06

    $mdy = $dt-&gt;mdy;         # 12-06-2002
    $mdy = $dt-&gt;mdy(&#39;/&#39;);    # 12/06/2002

    $dmy = $dt-&gt;dmy;         # 06-12-2002
    $dmy = $dt-&gt;dmy(&#39;/&#39;);    # 06/12/2002

    $hms = $dt-&gt;hms;         # 14:02:29
    $hms = $dt-&gt;hms(&#39;!&#39;);    # 14!02!29

    $is_leap = $dt-&gt;is_leap_year;

    # these are localizable, see Locales section
    $month_name = $dt-&gt;month_name;    # January, February, ...
    $month_abbr = $dt-&gt;month_abbr;    # Jan, Feb, ...
    $day_name   = $dt-&gt;day_name;      # Monday, Tuesday, ...
    $day_abbr   = $dt-&gt;day_abbr;      # Mon, Tue, ...

    # May not work for all possible datetime, see the docs on this
    # method for more details.
    $epoch_time = $dt-&gt;epoch;

    $dt2 = $dt + $duration_object;

    $dt3 = $dt - $duration_object;

    $duration_object = $dt - $dt2;

    $dt-&gt;set( year =&gt; 1882 );

    $dt-&gt;set_time_zone(&#39;America/Chicago&#39;);

    $dt-&gt;set_formatter($formatter);</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>DateTime is a class for the representation of date/time combinations, and is part of the Perl DateTime project.</p>

<p>It represents the Gregorian calendar, extended backwards in time before its creation (in 1582). This is sometimes known as the &quot;proleptic Gregorian calendar&quot;. In this calendar, the first day of the calendar (the epoch), is the first day of year 1, which corresponds to the date which was (incorrectly) believed to be the birth of Jesus Christ.</p>

<p>The calendar represented does have a year 0, and in that way differs from how dates are often written using &quot;BCE/CE&quot; or &quot;BC/AD&quot;.</p>

<p>For infinite datetimes, please see the <a href="https://metacpan.org/pod/DateTime::Infinite">DateTime::Infinite</a> module.</p>

<h1 id="USAGE">USAGE</h1>

<h2 id="0-based-Versus-1-based-Numbers"><a id="0"></a><a id="based-Versus-1-based-Numbers"></a>0-based Versus 1-based Numbers</h2>

<p>The <code>DateTime</code> module follows a simple logic for determining whether or not a given number is 0-based or 1-based.</p>

<p>Month, day of month, day of week, and day of year are 1-based. Any method that is 1-based also has an equivalent 0-based method ending in <code>_0</code>. So for example, this class provides both <code>day_of_week</code> and <code>day_of_week_0</code> methods.</p>

<p>The <code>day_of_week_0</code> method still treats Monday as the first day of the week.</p>

<p>All <i>time</i>-related numbers such as hour, minute, and second are 0-based.</p>

<p>Years are neither, as they can be both positive or negative, unlike any other datetime component. There <i>is</i> a year 0.</p>

<p>There is no <code>quarter_0</code> method.</p>

<h2 id="Error-Handling"><a id="Error"></a>Error Handling</h2>

<p>Some errors may cause this module to die with an error string. This can only happen when calling constructor methods, methods that change the object, such as <code>set</code>, or methods that take parameters. Methods that retrieve information about the object, such as <code>year</code> or <code>epoch</code>, will never die.</p>

<h2 id="Locales">Locales</h2>

<p>All the object methods which return names or abbreviations return data based on a locale. This is done by setting the locale when constructing a DateTime object. If this is not set, then <code>&quot;en-US&quot;</code> is used.</p>

<h2 id="Floating-DateTimes"><a id="Floating"></a>Floating DateTimes</h2>

<p>The default time zone for new DateTime objects, except where stated otherwise, is the &quot;floating&quot; time zone. This concept comes from the iCal standard. A floating datetime is one which is not anchored to any particular time zone. In addition, floating datetimes do not include leap seconds, since we cannot apply them without knowing the datetime&#39;s time zone.</p>

<p>The results of date math and comparison between a floating datetime and one with a real time zone are not really valid, because one includes leap seconds and the other does not. Similarly, the results of datetime math between two floating datetimes and two datetimes with time zones are not really comparable.</p>

<p>If you are planning to use any objects with a real time zone, it is strongly recommended that you <b>do not</b> mix these with floating datetimes.</p>

<h2 id="Math">Math</h2>

<p>If you are going to be doing date math, please read the section <a href="DateTime.html#How-DateTime-Math-Works">&quot;How DateTime Math Works&quot;</a>.</p>

<h2 id="Determining-the-Local-Time-Zone-Can-Be-Slow"><a id="Determining"></a>Determining the Local Time Zone Can Be Slow</h2>

<p>If <code>$ENV{TZ}</code> is not set, it may involve reading a number of files in <i>/etc</i> or elsewhere. If you know that the local time zone won&#39;t change while your code is running, and you need to make many objects for the local time zone, it is strongly recommended that you retrieve the local time zone once and cache it:</p>

<pre><code>    my $local_time_zone = DateTime::TimeZone-&gt;new( name =&gt; &#39;local&#39; );

    # then everywhere else

    my $dt = DateTime-&gt;new( ..., time_zone =&gt; $local_time_zone );</code></pre>

<p>DateTime itself does not do this internally because local time zones can change, and there&#39;s no good way to determine if it&#39;s changed without doing all the work to look it up.</p>

<h2 id="Far-Future-DST"><a id="Far"></a>Far Future DST</h2>

<p>Do not try to use named time zones (like &quot;America/Chicago&quot;) with dates very far in the future (thousands of years). The current implementation of <code>DateTime::TimeZone</code> will use a huge amount of memory calculating all the DST changes from now until the future date. Use UTC or the floating time zone and you will be safe.</p>

<h2 id="Globally-Setting-a-Default-Time-Zone"><a id="Globally"></a>Globally Setting a Default Time Zone</h2>

<p><b>Warning: This is very dangerous. Do this at your own risk!</b></p>

<p>By default, <code>DateTime</code> uses either the floating time zone or UTC for newly created objects, depending on the constructor.</p>

<p>You can force <code>DateTime</code> to use a different time zone by setting the <code>PERL_DATETIME_DEFAULT_TZ</code> environment variable.</p>

<p>As noted above, this is very dangerous, as it affects all code that creates a <code>DateTime</code> object, including modules from CPAN. If those modules expect the normal default, then setting this can cause confusing breakage or subtly broken data. Before setting this variable, you are strongly encouraged to audit your CPAN dependencies to see how they use <code>DateTime</code>. Try running the test suite for each dependency with this environment variable set before using this in production.</p>

<h2 id="Upper-and-Lower-Bounds"><a id="Upper"></a>Upper and Lower Bounds</h2>

<p>Internally, dates are represented the number of days before or after 0001-01-01. This is stored as an integer, meaning that the upper and lower bounds are based on your Perl&#39;s integer size (<code>$Config{ivsize}</code>).</p>

<p>The limit on 32-bit systems is around 2^29 days, which gets you to year (+/-)1,469,903. On a 64-bit system you get 2^62 days, to year (+/-)12,626,367,463,883,278 (12.626 quadrillion).</p>

<h1 id="METHODS">METHODS</h1>

<p>DateTime provides many methods. The documentation breaks them down into groups based on what they do (constructor, accessors, modifiers, etc.).</p>

<h2 id="Constructors">Constructors</h2>

<p>All constructors can die when invalid parameters are given.</p>

<h3 id="Warnings">Warnings</h3>

<p>Currently, constructors will warn if you try to create a far future DateTime (year &gt;= 5000) with any time zone besides floating or UTC. This can be very slow if the time zone has future DST transitions that need to be calculated. If the date is sufficiently far in the future this can be <i>really</i> slow (minutes).</p>

<p>All warnings from DateTime use the <code>DateTime</code> category and can be suppressed with:</p>

<pre><code>    no warnings &#39;DateTime&#39;;</code></pre>

<p>This warning may be removed in the future if <a href="https://metacpan.org/pod/DateTime::TimeZone">DateTime::TimeZone</a> is made much faster.</p>

<h3 id="DateTime-&gt;new(-...-)"><a id="DateTime"></a><a id="DateTime--new"></a>DateTime-&gt;new( ... )</h3>

<pre><code>    my $dt = DateTime-&gt;new(
        year       =&gt; 1966,
        month      =&gt; 10,
        day        =&gt; 25,
        hour       =&gt; 7,
        minute     =&gt; 15,
        second     =&gt; 47,
        nanosecond =&gt; 500000000,
        time_zone  =&gt; &#39;America/Chicago&#39;,
    );</code></pre>

<p>This class method accepts the following parameters:</p>

<ul>

<li><p>year</p>

<p>An integer year for the DateTime. This can be any integer number within the valid range for your system (See <a href="DateTime.html#Upper-and-Lower-Bounds">&quot;Upper and Lower Bounds&quot;</a>). This is required.</p>

</li>
<li><p>month</p>

<p>An integer from 1-12. Defaults to 1.</p>

</li>
<li><p>day</p>

<p>An integer from 1-31. The value will be validated based on the month, to prevent creating invalid dates like February 30. Defaults to 1.</p>

</li>
<li><p>hour</p>

<p>An integer from 0-23. Hour 0 is midnight at the beginning of the given date. Defaults to 0.</p>

</li>
<li><p>minute</p>

<p>An integer from 0-59. Defaults to 0.</p>

</li>
<li><p>second</p>

<p>An integer from 0-61. Values of 60 or 61 are only allowed when the specified date and time have a leap second. Defaults to 0.</p>

</li>
<li><p>nanosecond</p>

<p>An integer that is greater than or equal to 0. If this number is greater than 1 billion, it will be normalized into the second value for the DateTime object. Defaults to 0</p>

</li>
<li><p>locale</p>

<p>A string containing a locale code, like <code>&quot;en-US&quot;</code> or <code>&quot;zh-Hant-TW&quot;</code>, or an object returned by <code>DateTime::Locale-&gt;load</code>. See the <a href="https://metacpan.org/pod/DateTime::Locale">DateTime::Locale</a> documentation for details. Defaults to the value of <code>DateTime-&gt;DefaultLocale</code>, or <code>&quot;en-US&quot;</code> if the class default has not been set.</p>

</li>
<li><p>time_zone</p>

<p>A string containing a time zone name like &quot;America/Chicago&quot; or a <a href="https://metacpan.org/pod/DateTime::TimeZone">DateTime::TimeZone</a> object. Defaults to the value of <code>$ENV{PERL_DATETIME_DEFAULT_TZ}</code> or &quot;floating&quot; if that env var is not set. See <a href="DateTime.html#Globally-Setting-a-Default-Time-Zone">&quot;Globally Setting a Default Time Zone&quot;</a> for more details on that env var (and why you should not use it).</p>

<p>A string will simply be passed to the <code>DateTime::TimeZone-&gt;new</code> method as its <code>name</code> parameter. This string may be an Olson DB time zone name (&quot;America/Chicago&quot;), an offset string (&quot;+0630&quot;), or the words &quot;floating&quot; or &quot;local&quot;. See the <code>DateTime::TimeZone</code> documentation for more details.</p>

</li>
<li><p>formatter</p>

<p>An object or class name with a <code>format_datetime</code> method. This will be used to stringify the DateTime object. This is optional. If it is not specified, then stringification calls <code>$self-&gt;iso8601</code>.</p>

</li>
</ul>

<p>Invalid parameter types (like an array reference) will cause the constructor to die.</p>

<h4 id="Parsing-Dates"><a id="Parsing"></a>Parsing Dates</h4>

<p><b>This module does not parse dates!</b> That means there is no constructor to which you can pass things like &quot;March 3, 1970 12:34&quot;.</p>

<p>Instead, take a look at the various <a href="https://metacpan.org/search?q=datetime%3A%3Aformat">DateTime::Format::*</a> modules on CPAN. These parse all sorts of different date formats, and you&#39;re bound to find something that can handle your particular needs.</p>

<h4 id="Ambiguous-Local-Times"><a id="Ambiguous"></a>Ambiguous Local Times</h4>

<p>Because of Daylight Saving Time, it is possible to specify a local time that is ambiguous. For example, in the US in 2003, the transition from to saving to standard time occurred on October 26, at 02:00:00 local time. The local clock changed from 01:59:59 (saving time) to 01:00:00 (standard time). This means that the hour from 01:00:00 through 01:59:59 actually occurs twice, though the UTC time continues to move forward.</p>

<p>If you specify an ambiguous time, then the latest UTC time is always used, in effect always choosing standard time. In this case, you can simply subtract an hour from the object in order to move to saving time, for example:</p>

<pre><code>    # This object represent 01:30:00 standard time
    my $dt = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 10,
        day       =&gt; 26,
        hour      =&gt; 1,
        minute    =&gt; 30,
        second    =&gt; 0,
        time_zone =&gt; &#39;America/Chicago&#39;,
    );

    print $dt-&gt;hms;    # prints 01:30:00

    # Now the object represent 01:30:00 saving time
    $dt-&gt;subtract( hours =&gt; 1 );

    print $dt-&gt;hms;    # still prints 01:30:00</code></pre>

<p>Alternately, you could create the object with the UTC time zone and then call the <code>set_time_zone</code> method to change the time zone. This is a good way to ensure that the time is not ambiguous.</p>

<h4 id="Invalid-Local-Times"><a id="Invalid"></a>Invalid Local Times</h4>

<p>Another problem introduced by Daylight Saving Time is that certain local times just do not exist. For example, in the US in 2003, the transition from standard to saving time occurred on April 6, at the change to 2:00:00 local time. The local clock changed from 01:59:59 (standard time) to 03:00:00 (saving time). This means that there is no 02:00:00 through 02:59:59 on April 6!</p>

<p>Attempting to create an invalid time currently causes a fatal error.</p>

<h3 id="DateTime-&gt;from_epoch(-epoch-=&gt;-$epoch,-...-)"><a id="DateTime1"></a><a id="DateTime--from_epoch--epoch----epoch"></a>DateTime-&gt;from_epoch( epoch =&gt; $epoch, ... )</h3>

<p>This class method can be used to construct a new DateTime object from an epoch time instead of components. Just as with the <code>new</code> method, it accepts <code>time_zone</code>, <code>locale</code>, and <code>formatter</code> parameters.</p>

<p>You can also call it with a single unnamed argument, which will be treated as the epoch value.</p>

<p>If the epoch value is a non-integral value, it will be rounded to nearest microsecond.</p>

<p>By default, the returned object will be in the UTC time zone.</p>

<p>If you pass a <code>time_zone</code>, then this time zone will be applied <i>after</i> the object is constructed. In other words, the epoch value is always interpreted as being in the UTC time zone. Here&#39;s an example:</p>

<pre><code>    my $dt = DateTime-&gt;from_epoch(
        epoch     =&gt; 0,
        time_zone =&gt; &#39;Asia/Tokyo&#39;
    );
    say $dt; # Prints 1970-01-01T09:00:00 as Asia/Tokyo is +09:00 from UTC.
    $dt-&gt;set_time_zone(&#39;UTC&#39;);
    say $dt; # Prints 1970-01-01T00:00:00</code></pre>

<h3 id="DateTime-&gt;now(-...-)"><a id="DateTime2"></a><a id="DateTime--now"></a>DateTime-&gt;now( ... )</h3>

<p>This class method is equivalent to calling <code>from_epoch</code> with the value returned from Perl&#39;s <code>time</code> function. Just as with the <code>new</code> method, it accepts <code>time_zone</code> and <code>locale</code> parameters.</p>

<p>By default, the returned object will be in the UTC time zone.</p>

<p>If you want sub-second resolution, use the <a href="https://metacpan.org/pod/DateTime::HiRes">DateTime::HiRes</a> module&#39;s <code>DateTime::HiRes-&gt;now</code> method instead.</p>

<h3 id="DateTime-&gt;today(-...-)"><a id="DateTime3"></a><a id="DateTime--today"></a>DateTime-&gt;today( ... )</h3>

<p>This class method is equivalent to:</p>

<pre><code>    DateTime-&gt;now(@_)-&gt;truncate( to =&gt; &#39;day&#39; );</code></pre>

<h3 id="DateTime-&gt;last_day_of_month(-...-)"><a id="DateTime4"></a><a id="DateTime--last_day_of_month"></a>DateTime-&gt;last_day_of_month( ... )</h3>

<p>This constructor takes the same arguments as can be given to the <code>new</code> method, except for <code>day</code>. Additionally, both <code>year</code> and <code>month</code> are required.</p>

<h3 id="DateTime-&gt;from_day_of_year(-...-)"><a id="DateTime5"></a><a id="DateTime--from_day_of_year"></a>DateTime-&gt;from_day_of_year( ... )</h3>

<p>This constructor takes the same arguments as can be given to the <code>new</code> method, except that it does not accept a <code>month</code> or <code>day</code> argument. Instead, it requires both <code>year</code> and <code>day_of_year</code>. The day of year must be between 1 and 366, and 366 is only allowed for leap years.</p>

<h3 id="DateTime-&gt;from_object(-object-=&gt;-$object,-...-)"><a id="DateTime6"></a><a id="DateTime--from_object--object----object"></a>DateTime-&gt;from_object( object =&gt; $object, ... )</h3>

<p>This class method can be used to construct a new DateTime object from any object that implements the <code>utc_rd_values</code> method. All <code>DateTime::Calendar</code> modules must implement this method in order to provide cross-calendar compatibility. This method accepts a <code>locale</code> and <code>formatter</code> parameter</p>

<p>If the object passed to this method has a <code>time_zone</code> method, that is used to set the time zone of the newly created <code>DateTime</code> object.</p>

<p>Otherwise, the returned object will be in the floating time zone.</p>

<h3 id="$dt-&gt;clone"><a id="dt--clone"></a>$dt-&gt;clone</h3>

<p>This object method returns a new object that is replica of the object upon which the method is called.</p>

<h2 id="&quot;Get&quot;-Methods"><a id="Get--Methods"></a>&quot;Get&quot; Methods</h2>

<p>This class has many methods for retrieving information about an object.</p>

<h3 id="$dt-&gt;year"><a id="dt--year"></a>$dt-&gt;year</h3>

<p>Returns the year.</p>

<h3 id="$dt-&gt;ce_year"><a id="dt--ce_year"></a>$dt-&gt;ce_year</h3>

<p>Returns the year according to the BCE/CE numbering system. The year before year 1 in this system is year -1, aka &quot;1 BCE&quot;.</p>

<h3 id="$dt-&gt;era_name"><a id="dt--era_name"></a>$dt-&gt;era_name</h3>

<p>Returns the long name of the current era, something like &quot;Before Christ&quot;. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;era_abbr"><a id="dt--era_abbr"></a>$dt-&gt;era_abbr</h3>

<p>Returns the abbreviated name of the current era, something like &quot;BC&quot;. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;christian_era"><a id="dt--christian_era"></a>$dt-&gt;christian_era</h3>

<p>Returns a string, either &quot;BC&quot; or &quot;AD&quot;, according to the year.</p>

<h3 id="$dt-&gt;secular_era"><a id="dt--secular_era"></a>$dt-&gt;secular_era</h3>

<p>Returns a string, either &quot;BCE&quot; or &quot;CE&quot;, according to the year.</p>

<h3 id="$dt-&gt;year_with_era"><a id="dt--year_with_era"></a>$dt-&gt;year_with_era</h3>

<p>Returns a string containing the year immediately followed by the appropriate era abbreviation, based on the object&#39;s locale. The year is the absolute value of <code>ce_year</code>, so that year 1 is &quot;1&quot; and year 0 is &quot;1BC&quot;. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;year_with_christian_era"><a id="dt--year_with_christian_era"></a>$dt-&gt;year_with_christian_era</h3>

<p>Like <code>year_with_era</code>, but uses the <code>christian_era</code> method to get the era name.</p>

<h3 id="$dt-&gt;year_with_secular_era"><a id="dt--year_with_secular_era"></a>$dt-&gt;year_with_secular_era</h3>

<p>Like <code>year_with_era</code>, but uses the <code>secular_era</code> method to get the era name.</p>

<h3 id="$dt-&gt;month"><a id="dt--month"></a>$dt-&gt;month</h3>

<p>Returns the month of the year, from 1..12.</p>

<p>Also available as <code>$dt-&gt;mon</code>.</p>

<h3 id="$dt-&gt;month_name"><a id="dt--month_name"></a>$dt-&gt;month_name</h3>

<p>Returns the name of the current month. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;month_abbr"><a id="dt--month_abbr"></a>$dt-&gt;month_abbr</h3>

<p>Returns the abbreviated name of the current month. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;day"><a id="dt--day"></a>$dt-&gt;day</h3>

<p>Returns the day of the month, from 1..31.</p>

<p>Also available as <code>$dt-&gt;mday</code> and <code>$dt-&gt;day_of_month</code>.</p>

<h3 id="$dt-&gt;day_of_week"><a id="dt--day_of_week"></a>$dt-&gt;day_of_week</h3>

<p>Returns the day of the week as a number, from 1..7, with 1 being Monday and 7 being Sunday.</p>

<p>Also available as <code>$dt-&gt;wday</code> and <code>$dt-&gt;dow</code>.</p>

<h3 id="$dt-&gt;local_day_of_week"><a id="dt--local_day_of_week"></a>$dt-&gt;local_day_of_week</h3>

<p>Returns the day of the week as a number, from 1..7. The day corresponding to 1 will vary based on the locale. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;day_name"><a id="dt--day_name"></a>$dt-&gt;day_name</h3>

<p>Returns the name of the current day of the week. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;day_abbr"><a id="dt--day_abbr"></a>$dt-&gt;day_abbr</h3>

<p>Returns the abbreviated name of the current day of the week. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;day_of_year"><a id="dt--day_of_year"></a>$dt-&gt;day_of_year</h3>

<p>Returns the day of the year.</p>

<p>Also available as <code>$dt-&gt;doy</code>.</p>

<h3 id="$dt-&gt;quarter"><a id="dt--quarter"></a>$dt-&gt;quarter</h3>

<p>Returns the quarter of the year, from 1..4.</p>

<h3 id="$dt-&gt;quarter_name"><a id="dt--quarter_name"></a>$dt-&gt;quarter_name</h3>

<p>Returns the name of the current quarter. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;quarter_abbr"><a id="dt--quarter_abbr"></a>$dt-&gt;quarter_abbr</h3>

<p>Returns the abbreviated name of the current quarter. See the <a href="DateTime.html#Locales">&quot;Locales&quot;</a> section for more details.</p>

<h3 id="$dt-&gt;day_of_quarter"><a id="dt--day_of_quarter"></a>$dt-&gt;day_of_quarter</h3>

<p>Returns the day of the quarter.</p>

<p>Also available as <code>$dt-&gt;doq</code>.</p>

<h3 id="$dt-&gt;weekday_of_month"><a id="dt--weekday_of_month"></a>$dt-&gt;weekday_of_month</h3>

<p>Returns a number from 1..5 indicating which week day of the month this is. For example, June 9, 2003 is the second Monday of the month, and so this method returns 2 for that date.</p>

<h3 id="$dt-&gt;ymd($optional_separator),-$dt-&gt;mdy(...),-$dt-&gt;dmy(...)"><a id="dt--ymd-optional_separator---dt--mdy-...---dt--dmy"></a>$dt-&gt;ymd($optional_separator), $dt-&gt;mdy(...), $dt-&gt;dmy(...)</h3>

<p>Each method returns the year, month, and day, in the order indicated by the method name. Years are zero-padded to four digits. Months and days are 0-padded to two digits.</p>

<p>By default, the values are separated by a dash (-), but this can be overridden by passing a value to the method.</p>

<p>The <code>$dt-&gt;ymd</code> method is also available as <code>$dt-&gt;date</code>.</p>

<h3 id="$dt-&gt;hour"><a id="dt--hour"></a>$dt-&gt;hour</h3>

<p>Returns the hour of the day, from 0..23.</p>

<h3 id="$dt-&gt;hour_1"><a id="dt--hour_1"></a>$dt-&gt;hour_1</h3>

<p>Returns the hour of the day, from 1..24.</p>

<h3 id="$dt-&gt;hour_12"><a id="dt--hour_12"></a>$dt-&gt;hour_12</h3>

<p>Returns the hour of the day, from 1..12.</p>

<h3 id="$dt-&gt;hour_12_0"><a id="dt--hour_12_0"></a>$dt-&gt;hour_12_0</h3>

<p>Returns the hour of the day, from 0..11.</p>

<h3 id="$dt-&gt;am_or_pm"><a id="dt--am_or_pm"></a>$dt-&gt;am_or_pm</h3>

<p>Returns the appropriate localized abbreviation, depending on the current hour.</p>

<h3 id="$dt-&gt;minute"><a id="dt--minute"></a>$dt-&gt;minute</h3>

<p>Returns the minute of the hour, from 0..59.</p>

<p>Also available as <code>$dt-&gt;min</code>.</p>

<h3 id="$dt-&gt;second"><a id="dt--second"></a>$dt-&gt;second</h3>

<p>Returns the second, from 0..61. The values 60 and 61 are used for leap seconds.</p>

<p>Also available as <code>$dt-&gt;sec</code>.</p>

<h3 id="$dt-&gt;fractional_second"><a id="dt--fractional_second"></a>$dt-&gt;fractional_second</h3>

<p>Returns the second, as a real number from 0.0 until 61.999999999</p>

<p>The values 60 and 61 are used for leap seconds.</p>

<h3 id="$dt-&gt;millisecond"><a id="dt--millisecond"></a>$dt-&gt;millisecond</h3>

<p>Returns the fractional part of the second as milliseconds (1E-3 seconds).</p>

<p>Half a second is 500 milliseconds.</p>

<p>This value will always be rounded down to the nearest integer.</p>

<h3 id="$dt-&gt;microsecond"><a id="dt--microsecond"></a>$dt-&gt;microsecond</h3>

<p>Returns the fractional part of the second as microseconds (1E-6 seconds).</p>

<p>Half a second is 500,000 microseconds.</p>

<p>This value will always be rounded down to the nearest integer.</p>

<h3 id="$dt-&gt;nanosecond"><a id="dt--nanosecond"></a>$dt-&gt;nanosecond</h3>

<p>Returns the fractional part of the second as nanoseconds (1E-9 seconds).</p>

<pre><code> Half a second is 500,000,000 nanoseconds.</code></pre>

<h3 id="$dt-&gt;hms($optional_separator)"><a id="dt--hms-optional_separator"></a>$dt-&gt;hms($optional_separator)</h3>

<p>Returns the hour, minute, and second, all zero-padded to two digits. If no separator is specified, a colon (:) is used by default.</p>

<p>Also available as <code>$dt-&gt;time</code>.</p>

<h3 id="$dt-&gt;datetime($optional_separator)"><a id="dt--datetime-optional_separator"></a>$dt-&gt;datetime($optional_separator)</h3>

<p>This method is equivalent to:</p>

<pre><code>    $dt-&gt;ymd(&#39;-&#39;) . &#39;T&#39; . $dt-&gt;hms(&#39;:&#39;)</code></pre>

<p>The <code>$optional_separator</code> parameter allows you to override the separator between the date and time, for e.g. <code>$dt-&gt;datetime(q{ })</code>.</p>

<p>This method is also available as <code>$dt-&gt;iso8601</code>, but it&#39;s not really a very good ISO8601 format, as it lacks a time zone. If called as <code>$dt-&gt;iso8601</code> you cannot change the separator, as ISO8601 specifies that &quot;T&quot; must be used to separate them.</p>

<h3 id="$dt-&gt;rfc3339"><a id="dt--rfc3339"></a>$dt-&gt;rfc3339</h3>

<p>This formats a datetime in RFC3339 format. This is the same as <code>$dt-&gt;datetime</code> with an added offset at the end of the string except if the time zone is the floating time zone.</p>

<p>If the offset is &#39;+00:00&#39; then this is represented as &#39;Z&#39;. Otherwise the offset is formatted with a leading sign (+/-) and a colon separated numeric offset with hours and minutes. If the offset has a non-zero seconds component, that is also included.</p>

<h3 id="$dt-&gt;stringify"><a id="dt--stringify"></a>$dt-&gt;stringify</h3>

<p>This method returns a stringified version of the object. It is also how stringification overloading is implemented. If the object has a formatter, then its <code>format_datetime</code> method is used to produce a string. Otherwise, this method calls <code>$dt-&gt;iso8601</code> to produce a string. See <a href="DateTime.html#Formatters-And-Stringification">&quot;Formatters And Stringification&quot;</a> for details.</p>

<h3 id="$dt-&gt;is_leap_year"><a id="dt--is_leap_year"></a>$dt-&gt;is_leap_year</h3>

<p>This method returns a boolean value indicating whether or not the datetime object is in a leap year.</p>

<h3 id="$dt-&gt;is_last_day_of_month"><a id="dt--is_last_day_of_month"></a>$dt-&gt;is_last_day_of_month</h3>

<p>This method returns a boolean value indicating whether or not the datetime object is the last day of the month.</p>

<h3 id="$dt-&gt;is_last_day_of_quarter"><a id="dt--is_last_day_of_quarter"></a>$dt-&gt;is_last_day_of_quarter</h3>

<p>This method returns a boolean value indicating whether or not the datetime object is the last day of the quarter.</p>

<h3 id="$dt-&gt;is_last_day_of_year"><a id="dt--is_last_day_of_year"></a>$dt-&gt;is_last_day_of_year</h3>

<p>This method returns a boolean value indicating whether or not the datetime object is the last day of the year.</p>

<h3 id="$dt-&gt;month_length"><a id="dt--month_length"></a>$dt-&gt;month_length</h3>

<p>This method returns the number of days in the current month.</p>

<h3 id="$dt-&gt;quarter_length"><a id="dt--quarter_length"></a>$dt-&gt;quarter_length</h3>

<p>This method returns the number of days in the current quarter.</p>

<h3 id="$dt-&gt;year_length"><a id="dt--year_length"></a>$dt-&gt;year_length</h3>

<p>This method returns the number of days in the current year.</p>

<h3 id="$dt-&gt;week"><a id="dt--week"></a>$dt-&gt;week</h3>

<pre><code>   my ( $week_year, $week_number ) = $dt-&gt;week;</code></pre>

<p>Returns information about the calendar week for the date. The values returned by this method are also available separately through the <code>$dt-&gt;week_year</code> and <code>$dt-&gt;week_number</code> methods.</p>

<p>The first week of the year is defined by ISO as the one which contains the fourth day of January, which is equivalent to saying that it&#39;s the first week to overlap the new year by at least four days.</p>

<p>Typically the week year will be the same as the year that the object is in, but dates at the very beginning of a calendar year often end up in the last week of the prior year, and similarly, the final few days of the year may be placed in the first week of the next year.</p>

<h3 id="$dt-&gt;week_year"><a id="dt--week_year"></a>$dt-&gt;week_year</h3>

<p>Returns the year of the week. See <code>$dt-&gt;week</code> for details.</p>

<h3 id="$dt-&gt;week_number"><a id="dt--week_number"></a>$dt-&gt;week_number</h3>

<p>Returns the week of the year, from 1..53. See <code>$dt-&gt;week</code> for details.</p>

<h3 id="$dt-&gt;week_of_month"><a id="dt--week_of_month"></a>$dt-&gt;week_of_month</h3>

<p>The week of the month, from 0..5. The first week of the month is the first week that contains a Thursday. This is based on the ICU definition of week of month, and correlates to the ISO8601 week of year definition. A day in the week <i>before</i> the week with the first Thursday will be week 0.</p>

<h3 id="$dt-&gt;jd,-$dt-&gt;mjd"><a id="dt--jd---dt--mjd"></a>$dt-&gt;jd, $dt-&gt;mjd</h3>

<p>These return the Julian Day and Modified Julian Day, respectively. The value returned is a floating point number. The fractional portion of the number represents the time portion of the datetime.</p>

<p>The Julian Day is a count of days since the beginning of the Julian Period, which starts with day 0 at noon on January 1, -4712.</p>

<p>The Modified Julian Day is a count of days since midnight on November 17, 1858.</p>

<p>These methods always refer to the local time, so the Julian Day is the same for a given datetime regardless of its time zone. Or in other words, 2020-12-04T13:01:57 in &quot;America/Chicago&quot; has the same Julian Day as 2020-12-04T13:01:57 in &quot;Asia/Taipei&quot;.</p>

<h3 id="$dt-&gt;time_zone"><a id="dt--time_zone"></a>$dt-&gt;time_zone</h3>

<p>This returns the <a href="https://metacpan.org/pod/DateTime::TimeZone">DateTime::TimeZone</a> object for the datetime object.</p>

<h3 id="$dt-&gt;offset"><a id="dt--offset"></a>$dt-&gt;offset</h3>

<p>This returns the offset from UTC, in seconds, of the datetime object&#39;s time zone.</p>

<h3 id="$dt-&gt;is_dst"><a id="dt--is_dst"></a>$dt-&gt;is_dst</h3>

<p>Returns a boolean indicating whether or not the datetime&#39;s time zone is currently in Daylight Saving Time or not.</p>

<h3 id="$dt-&gt;time_zone_long_name"><a id="dt--time_zone_long_name"></a>$dt-&gt;time_zone_long_name</h3>

<p>This is a shortcut for <code>$dt-&gt;time_zone-&gt;name</code>. It&#39;s provided so that one can use &quot;%{time_zone_long_name}&quot; as a strftime format specifier.</p>

<h3 id="$dt-&gt;time_zone_short_name"><a id="dt--time_zone_short_name"></a>$dt-&gt;time_zone_short_name</h3>

<p>This method returns the time zone abbreviation for the current time zone, such as &quot;PST&quot; or &quot;GMT&quot;. These names are <b>not</b> definitive, and should not be used in any application intended for general use by users around the world. That&#39;s because it&#39;s possible for multiple time zones to have the same abbreviation.</p>

<h3 id="$dt-&gt;strftime(-$format,-...-)"><a id="dt--strftime---format"></a>$dt-&gt;strftime( $format, ... )</h3>

<p>This method implements functionality similar to the <code>strftime</code> method in C. However, if given multiple format strings, then it will return multiple scalars, one for each format string.</p>

<p>See the <a href="DateTime.html#strftime-Patterns">&quot;strftime Patterns&quot;</a> section for a list of all possible strftime patterns.</p>

<p>If you give a pattern that doesn&#39;t exist, then it is simply treated as text.</p>

<p>Note that any deviation from the POSIX standard is probably a bug. DateTime should match the output of <code>POSIX::strftime</code> for any given pattern.</p>

<h3 id="$dt-&gt;format_cldr(-$format,-...-)"><a id="dt--format_cldr---format"></a>$dt-&gt;format_cldr( $format, ... )</h3>

<p>This method implements formatting based on the CLDR date patterns. If given multiple format strings, then it will return multiple scalars, one for each format string.</p>

<p>See the <a href="DateTime.html#CLDR-Patterns">&quot;CLDR Patterns&quot;</a> section for a list of all possible CLDR patterns.</p>

<p>If you give a pattern that doesn&#39;t exist, then it is simply treated as text.</p>

<h3 id="$dt-&gt;epoch"><a id="dt--epoch"></a>$dt-&gt;epoch</h3>

<p>Returns the UTC epoch value for the datetime object. Datetimes before the start of the epoch will be returned as a negative number.</p>

<p>The return value from this method is always an integer number of seconds.</p>

<p>Since the epoch does not account for leap seconds, the epoch time for 1972-12-31T23:59:60 (UTC) is exactly the same as that for 1973-01-01T00:00:00.</p>

<h3 id="$dt-&gt;hires_epoch"><a id="dt--hires_epoch"></a>$dt-&gt;hires_epoch</h3>

<p>Returns the epoch as a floating point number. The floating point portion of the value represents the nanosecond value of the object. This method is provided for compatibility with the <code>Time::HiRes</code> module.</p>

<p>Note that this method suffers from the imprecision of floating point numbers, and the result may end up rounded to an arbitrary degree depending on your platform.</p>

<pre><code>    my $dt = DateTime-&gt;new( year =&gt; 2012, nanosecond =&gt; 4 );
    say $dt-&gt;hires_epoch;</code></pre>

<p>On my system, this simply prints <code>1325376000</code> because adding <code>0.000000004</code> to <code>1325376000</code> returns <code>1325376000</code>.</p>

<h3 id="$dt-&gt;is_finite,-$dt-&gt;is_infinite"><a id="dt--is_finite---dt--is_infinite"></a>$dt-&gt;is_finite, $dt-&gt;is_infinite</h3>

<p>These methods allow you to distinguish normal datetime objects from infinite ones. Infinite datetime objects are documented in <a href="https://metacpan.org/pod/DateTime::Infinite">DateTime::Infinite</a>.</p>

<h3 id="$dt-&gt;utc_rd_values"><a id="dt--utc_rd_values"></a>$dt-&gt;utc_rd_values</h3>

<p>Returns the current UTC Rata Die days, seconds, and nanoseconds as a three element list. This exists primarily to allow other calendar modules to create objects based on the values provided by this object.</p>

<h3 id="$dt-&gt;local_rd_values"><a id="dt--local_rd_values"></a>$dt-&gt;local_rd_values</h3>

<p>Returns the current local Rata Die days, seconds, and nanoseconds as a three element list. This exists for the benefit of other modules which might want to use this information for date math, such as <a href="https://metacpan.org/pod/DateTime::Event::Recurrence">DateTime::Event::Recurrence</a>.</p>

<h3 id="$dt-&gt;leap_seconds"><a id="dt--leap_seconds"></a>$dt-&gt;leap_seconds</h3>

<p>Returns the number of leap seconds that have happened up to the datetime represented by the object. For floating datetimes, this always returns 0.</p>

<h3 id="$dt-&gt;utc_rd_as_seconds"><a id="dt--utc_rd_as_seconds"></a>$dt-&gt;utc_rd_as_seconds</h3>

<p>Returns the current UTC Rata Die days and seconds purely as seconds. This number ignores any fractional seconds stored in the object, as well as leap seconds.</p>

<h3 id="$dt-&gt;locale"><a id="dt--locale"></a>$dt-&gt;locale</h3>

<p>Returns the datetime&#39;s <a href="https://metacpan.org/pod/DateTime::Locale">DateTime::Locale</a> object.</p>

<h3 id="$dt-&gt;formatter"><a id="dt--formatter"></a>$dt-&gt;formatter</h3>

<p>Returns the current formatter object or class. See <a href="DateTime.html#Formatters-And-Stringification">&quot;Formatters And Stringification&quot;</a> for details.</p>

<h2 id="&quot;Set&quot;-Methods"><a id="Set--Methods"></a>&quot;Set&quot; Methods</h2>

<p>The remaining methods provided by <code>DateTime</code>, except where otherwise specified, return the object itself, thus making method chaining possible. For example:</p>

<pre><code>    my $dt = DateTime-&gt;now-&gt;set_time_zone( &#39;Australia/Sydney&#39; );

    my $first = DateTime
                    -&gt;last_day_of_month( year =&gt; 2003, month =&gt; 3 )
                    -&gt;add( days =&gt; 1 )
                    -&gt;subtract( seconds =&gt; 1 );</code></pre>

<h3 id="$dt-&gt;set(-..-)"><a id="dt--set"></a>$dt-&gt;set( .. )</h3>

<p>This method can be used to change the local components of a date time. This method accepts any parameter allowed by the <code>new</code> method except for <code>locale</code> or <code>time_zone</code>. Use <code>set_locale</code> and <code>set_time_zone</code> for those instead.</p>

<p>This method performs parameter validation just like the <code>new</code> method.</p>

<p><b>Do not use this method to do date math. Use the <code>add</code> and <code>subtract</code> methods instead.</b></p>

<h3 id="$dt-&gt;set_year,-$dt-&gt;set_month,-etc."><a id="dt--set_year---dt--set_month--etc"></a>$dt-&gt;set_year, $dt-&gt;set_month, etc.</h3>

<p>DateTime has a <code>set_*</code> method for every item that can be passed to the constructor:</p>

<ul>

<li><p>$dt-&gt;set_year</p>

</li>
<li><p>$dt-&gt;set_month</p>

</li>
<li><p>$dt-&gt;set_day</p>

</li>
<li><p>$dt-&gt;set_hour</p>

</li>
<li><p>$dt-&gt;set_minute</p>

</li>
<li><p>$dt-&gt;set_second</p>

</li>
<li><p>$dt-&gt;set_nanosecond</p>

</li>
</ul>

<p>These are shortcuts to calling <code>set</code> with a single key. They all take a single parameter.</p>

<h3 id="$dt-&gt;truncate(-to-=&gt;-...-)"><a id="dt--truncate--to"></a>$dt-&gt;truncate( to =&gt; ... )</h3>

<p>This method allows you to reset some of the local time components in the object to their &quot;zero&quot; values. The <code>to</code> parameter is used to specify which values to truncate, and it may be one of <code>&quot;year&quot;</code>, <code>&quot;quarter&quot;</code>, <code>&quot;month&quot;</code>, <code>&quot;week&quot;</code>, <code>&quot;local_week&quot;</code>, <code>&quot;day&quot;</code>, <code>&quot;hour&quot;</code>, <code>&quot;minute&quot;</code>, or <code>&quot;second&quot;</code>.</p>

<p>For example, if <code>&quot;month&quot;</code> is specified, then the local day becomes 1, and the hour, minute, and second all become 0.</p>

<p>If <code>&quot;week&quot;</code> is given, then the datetime is set to the Monday of the week in which it occurs, and the time components are all set to 0. If you truncate to <code>&quot;local_week&quot;</code>, then the first day of the week is locale-dependent. For example, in the <code>&quot;en-US&quot;</code> locale, the first day of the week is Sunday.</p>

<h3 id="$dt-&gt;set_locale($locale)"><a id="dt--set_locale-locale"></a>$dt-&gt;set_locale($locale)</h3>

<p>Sets the object&#39;s locale. You can provide either a locale code like <code>&quot;en-US&quot;</code> or an object returned by <code>DateTime::Locale-&gt;load</code>.</p>

<h3 id="$dt-&gt;set_time_zone($tz)"><a id="dt--set_time_zone-tz"></a>$dt-&gt;set_time_zone($tz)</h3>

<p>This method accepts either a time zone object or a string that can be passed as the <code>name</code> parameter to <code>DateTime::TimeZone-&gt;new</code>. If the new time zone&#39;s offset is different from the old time zone, then the <i>local</i> time is adjusted accordingly.</p>

<p>For example:</p>

<pre><code>    my $dt = DateTime-&gt;new(
        year      =&gt; 2000,
        month     =&gt; 5,
        day       =&gt; 10,
        hour      =&gt; 15,
        minute    =&gt; 15,
        time_zone =&gt; &#39;America/Los_Angeles&#39;,
    );

    print $dt-&gt;hour;    # prints 15

    $dt-&gt;set_time_zone(&#39;America/Chicago&#39;);

    print $dt-&gt;hour;    # prints 17</code></pre>

<p>If the old time zone was a floating time zone, then no adjustments to the local time are made, except to account for leap seconds. If the new time zone is floating, then the <i>UTC</i> time is adjusted in order to leave the local time untouched.</p>

<p>Fans of Tsai Ming-Liang&#39;s films will be happy to know that this does work:</p>

<pre><code>    my $dt = DateTime-&gt;now( time_zone =&gt; &#39;Asia/Taipei&#39; );
    $dt-&gt;set_time_zone(&#39;Europe/Paris&#39;);</code></pre>

<p>Yes, now we can know &quot;ni3 na4 bian1 ji2 dian3?&quot;</p>

<h3 id="$dt-&gt;set_formatter($formatter)"><a id="dt--set_formatter-formatter"></a>$dt-&gt;set_formatter($formatter)</h3>

<p>Sets the formatter for the object. See <a href="DateTime.html#Formatters-And-Stringification">&quot;Formatters And Stringification&quot;</a> for details.</p>

<p>You can set this to <code>undef</code> to revert to the default formatter.</p>

<h2 id="Math-Methods"><a id="Math1"></a>Math Methods</h2>

<p>Like the set methods, math related methods always return the object itself, to allow for chaining:</p>

<pre><code>    $dt-&gt;add( days =&gt; 1 )-&gt;subtract( seconds =&gt; 1 );</code></pre>

<h3 id="$dt-&gt;duration_class"><a id="dt--duration_class"></a>$dt-&gt;duration_class</h3>

<p>This returns <a href="https://metacpan.org/pod/DateTime::Duration"><code>&quot;DateTime::Duration&quot;</code></a>, but exists so that a subclass of <code>DateTime</code> can provide a different value.</p>

<h3 id="$dt-&gt;add_duration($duration_object)"><a id="dt--add_duration-duration_object"></a>$dt-&gt;add_duration($duration_object)</h3>

<p>This method adds a <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> to the current datetime. See the <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> docs for more details.</p>

<h3 id="$dt-&gt;add(-parameters-for-DateTime::Duration-)"><a id="dt--add--parameters-for-DateTime::Duration"></a>$dt-&gt;add( parameters for DateTime::Duration )</h3>

<p>This method is syntactic sugar around the <code>$dt-&gt;add_duration</code> method. It simply creates a new <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> object using the parameters given, and then calls the <code>$dt-&gt;add_duration</code> method.</p>

<h3 id="$dt-&gt;add($duration_object)"><a id="dt--add-duration_object"></a>$dt-&gt;add($duration_object)</h3>

<p>A synonym of <code>$dt-&gt;add_duration($duration_object)</code>.</p>

<h3 id="$dt-&gt;subtract_duration($duration_object)"><a id="dt--subtract_duration-duration_object"></a>$dt-&gt;subtract_duration($duration_object)</h3>

<p>When given a <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> object, this method simply calls <code>$dur-&gt;inverse</code> on that object and passes that new duration to the <code>$self-&gt;add_duration</code> method.</p>

<h3 id="$dt-&gt;subtract(-DateTime::Duration-&gt;new-parameters-)"><a id="dt--subtract--DateTime::Duration--new-parameters"></a>$dt-&gt;subtract( DateTime::Duration-&gt;new parameters )</h3>

<p>Like <code>$dt-&gt;add</code>, this is syntactic sugar for the <code>$dt-&gt;subtract_duration</code> method.</p>

<h3 id="$dt-&gt;subtract($duration_object)"><a id="dt--subtract-duration_object"></a>$dt-&gt;subtract($duration_object)</h3>

<p>A synonym of <code>$dt-&gt;subtract_duration($duration_object)</code>.</p>

<h3 id="$dt-&gt;subtract_datetime($datetime)"><a id="dt--subtract_datetime-datetime"></a>$dt-&gt;subtract_datetime($datetime)</h3>

<p>This method returns a new <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> object representing the difference between the two dates. The duration is <b>relative</b> to the object from which <code>$datetime</code> is subtracted. For example:</p>

<pre><code>    2003-03-15 00:00:00.00000000
 -  2003-02-15 00:00:00.00000000
 -------------------------------
 = 1 month</code></pre>

<p>Note that this duration is not an absolute measure of the amount of time between the two datetimes, because the length of a month varies, as well as due to the presence of leap seconds.</p>

<p>The returned duration may have deltas for months, days, minutes, seconds, and nanoseconds.</p>

<h3 id="$dt-&gt;delta_md($datetime),-$dt-&gt;delta_days($datetime)"><a id="dt--delta_md-datetime---dt--delta_days-datetime"></a>$dt-&gt;delta_md($datetime), $dt-&gt;delta_days($datetime)</h3>

<p>Each of these methods returns a new <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> object representing some portion of the difference between two datetimes. The <code>$dt-&gt;delta_md</code> method returns a duration which contains only the month and day portions of the duration is represented. The <code>$dt-&gt;delta_days</code> method returns a duration which contains only days.</p>

<p>The <code>$dt-&gt;delta_md</code> and <code>$dt-&gt;delta_days</code> methods truncate the duration so that any fractional portion of a day is ignored. Both of these methods operate on the date portion of a datetime only, and so effectively ignore the time zone.</p>

<p>Unlike the subtraction methods, <b>these methods always return a positive (or zero) duration</b>.</p>

<h3 id="$dt-&gt;delta_ms($datetime)"><a id="dt--delta_ms-datetime"></a>$dt-&gt;delta_ms($datetime)</h3>

<p>Returns a duration which contains only minutes and seconds. Any day and month differences are converted to minutes and seconds. This method <b>always returns a positive (or zero) duration</b>.</p>

<h3 id="$dt-&gt;subtract_datetime_absolute($datetime)"><a id="dt--subtract_datetime_absolute-datetime"></a>$dt-&gt;subtract_datetime_absolute($datetime)</h3>

<p>This method returns a new <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> object representing the difference between the two dates in seconds and nanoseconds. This is the only way to accurately measure the absolute amount of time between two datetimes, since units larger than a second do not represent a fixed number of seconds.</p>

<p>Note that because of leap seconds, this may not return the same result as doing this math based on the value returned by <code>$dt-&gt;epoch</code>.</p>

<h3 id="$dt-&gt;is_between(-$lower,-$upper-)"><a id="dt--is_between---lower---upper"></a>$dt-&gt;is_between( $lower, $upper )</h3>

<p>Checks whether <code>$dt</code> is strictly between two other DateTime objects.</p>

<p>&quot;Strictly&quot; means that <code>$dt</code> must be greater than <code>$lower</code> and less than <code>$upper</code>. If it is <i>equal</i> to either object then this method returns false.</p>

<h2 id="Class-Methods"><a id="Class"></a>Class Methods</h2>

<h3 id="DateTime-&gt;DefaultLocale($locale)"><a id="DateTime7"></a><a id="DateTime--DefaultLocale-locale"></a>DateTime-&gt;DefaultLocale($locale)</h3>

<p>This can be used to specify the default locale to be used when creating DateTime objects. If unset, then <code>&quot;en-US&quot;</code> is used.</p>

<p>This exists for backwards compatibility, but is probably best avoided. This will change the default locale for every <code>DateTime</code> object created in your application, even those created by third party libraries which also use <code>DateTime</code>.</p>

<h3 id="DateTime-&gt;compare(-$dt1,-$dt2-),-DateTime-&gt;compare_ignore_floating(-$dt1,-$dt2-)"><a id="DateTime8"></a><a id="DateTime--compare---dt1---dt2---DateTime--compare_ignore_floating---dt1---dt2"></a>DateTime-&gt;compare( $dt1, $dt2 ), DateTime-&gt;compare_ignore_floating( $dt1, $dt2 )</h3>

<pre><code>    $cmp = DateTime-&gt;compare( $dt1, $dt2 );

    $cmp = DateTime-&gt;compare_ignore_floating( $dt1, $dt2 );</code></pre>

<p>This method compare two DateTime objects. The semantics are compatible with Perl&#39;s <code>sort</code> function; it returns <code>-1</code> if <code>$dt1 &lt; $dt2</code>, <code>0</code> if <code>$dt1 == $dt2</code>, <code>1</code> if <code>$dt1 &gt; $dt2</code>.</p>

<p>If one of the two DateTime objects has a floating time zone, it will first be converted to the time zone of the other object. This is what you want most of the time, but it can lead to inconsistent results when you compare a number of DateTime objects, some of which are floating, and some of which are in other time zones.</p>

<p>If you want to have consistent results (because you want to sort an array of objects, for example), you can use the <code>compare_ignore_floating</code> method:</p>

<pre><code>    @dates = sort { DateTime-&gt;compare_ignore_floating( $a, $b ) } @dates;</code></pre>

<p>In this case, objects with a floating time zone will be sorted as if they were UTC times.</p>

<p>Since DateTime objects overload comparison operators, this:</p>

<pre><code>    @dates = sort @dates;</code></pre>

<p>is equivalent to this:</p>

<pre><code>    @dates = sort { DateTime-&gt;compare( $a, $b ) } @dates;</code></pre>

<p>DateTime objects can be compared to any other calendar class that implements the <code>utc_rd_values</code> method.</p>

<h2 id="Testing-Code-That-Uses-DateTime"><a id="Testing"></a>Testing Code That Uses DateTime</h2>

<p>If you are trying to test code that calls uses DateTime, you may want to be to explicitly set the value returned by Perl&#39;s <code>time</code> builtin. This builtin is called by <code>DateTime-&gt;now</code> and <code>DateTime-&gt;today</code>.</p>

<p>You can override <code>CORE::GLOBAL::time</code>, but this will only work if you do this <b>before</b> loading DateTime. If doing this is inconvenient, you can also override <code>DateTime::_core_time</code>:</p>

<pre><code>    no warnings &#39;redefine&#39;;
    local *DateTime::_core_time = sub { return 42 };</code></pre>

<p>DateTime is guaranteed to call this subroutine to get the current <code>time</code> value. You can also override the <code>_core_time</code> sub in a subclass of DateTime and use that.</p>

<h2 id="How-DateTime-Math-Works"><a id="How"></a>How DateTime Math Works</h2>

<p>It&#39;s important to have some understanding of how datetime math is implemented in order to effectively use this module and <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a>.</p>

<h3 id="Making-Things-Simple"><a id="Making"></a>Making Things Simple</h3>

<p>If you want to simplify your life and not have to think too hard about the nitty-gritty of datetime math, I have several recommendations:</p>

<ul>

<li><p>use the floating time zone</p>

<p>If you do not care about time zones or leap seconds, use the &quot;floating&quot; timezone:</p>

<pre><code>    my $dt = DateTime-&gt;now( time_zone =&gt; &#39;floating&#39; );</code></pre>

<p>Math done on two objects in the floating time zone produces very predictable results.</p>

<p>Note that in most cases you will want to start by creating an object in a specific zone and <i>then</i> convert it to the floating time zone. When an object goes from a real zone to the floating zone, the time for the object remains the same.</p>

<p>This means that passing the floating zone to a constructor may not do what you want.</p>

<pre><code>    my $dt = DateTime-&gt;now( time_zone =&gt; &#39;floating&#39; );</code></pre>

<p>is equivalent to</p>

<pre><code>    my $dt = DateTime-&gt;now( time_zone =&gt; &#39;UTC&#39; )-&gt;set_time_zone(&#39;floating&#39;);</code></pre>

<p>This might not be what you wanted. Instead, you may prefer to do this:</p>

<pre><code>    my $dt = DateTime-&gt;now( time_zone =&gt; &#39;local&#39; )-&gt;set_time_zone(&#39;floating&#39;);</code></pre>

</li>
<li><p>use UTC for all calculations</p>

<p>If you do care about time zones (particularly DST) or leap seconds, try to use non-UTC time zones for presentation and user input only. Convert to UTC immediately and convert back to the local time zone for presentation:</p>

<pre><code>    my $dt = DateTime-&gt;new( %user_input, time_zone =&gt; $user_tz );
    $dt-&gt;set_time_zone(&#39;UTC&#39;);

    # do various operations - store it, retrieve it, add, subtract, etc.

    $dt-&gt;set_time_zone($user_tz);
    print $dt-&gt;datetime;</code></pre>

</li>
<li><p>math on non-UTC time zones</p>

<p>If you need to do date math on objects with non-UTC time zones, please read the caveats below carefully. The results <code>DateTime</code> produces are predictable, correct, and mostly intuitive, but datetime math gets very ugly when time zones are involved, and there are a few strange corner cases involving subtraction of two datetimes across a DST change.</p>

<p>If you can always use the floating or UTC time zones, you can skip ahead to <a href="DateTime.html#Leap-Seconds-and-Date-Math">&quot;Leap Seconds and Date Math&quot;</a></p>

</li>
<li><p>date vs datetime math</p>

<p>If you only care about the date (calendar) portion of a datetime, you should use either <code>$dt-&gt;delta_md</code> or <code>$dt-&gt;delta_days</code>, not <code>$dt-&gt;subtract_datetime</code>. This will give predictable, unsurprising results, free from DST-related complications.</p>

</li>
<li><p>$dt-&gt;subtract_datetime and $dt-&gt;add_duration</p>

<p>You must convert your datetime objects to the UTC time zone before doing date math if you want to make sure that the following formulas are always true:</p>

<pre><code>    $dt2 - $dt1 = $dur
    $dt1 + $dur = $dt2
    $dt2 - $dur = $dt1</code></pre>

<p>Note that using <code>$dt-&gt;delta_days</code> ensures that this formula always works, regardless of the time zones of the objects involved, as does using <code>$dt-&gt;subtract_datetime_absolute</code>. Other methods of subtraction are not always reversible.</p>

</li>
<li><p>never do math on two objects where only one is in the floating time zone</p>

<p>The date math code accounts for leap seconds whenever the <code>DateTime</code> object is not in the floating time zone. If you try to do math where one object is in the floating zone and the other isn&#39;t, the results will be confusing and wrong.</p>

</li>
</ul>

<h3 id="Adding-a-Duration-to-a-DateTime"><a id="Adding"></a>Adding a Duration to a DateTime</h3>

<p>The parts of a duration can be broken down into five parts. These are months, days, minutes, seconds, and nanoseconds. Adding one month to a date is different than adding 4 weeks or 28, 29, 30, or 31 days. Similarly, due to DST and leap seconds, adding a day can be different than adding 86,400 seconds, and adding a minute is not exactly the same as 60 seconds.</p>

<p>We cannot convert between these units, except for seconds and nanoseconds, because there is no fixed conversion between most pairs of units. That is because of things like leap seconds, DST changes, etc.</p>

<p><code>DateTime</code> always adds (or subtracts) days, then months, minutes, and then seconds and nanoseconds. If there are any boundary overflows, these are normalized at each step. For the days and months the local (not UTC) values are used. For minutes and seconds, the local values are used. This generally just works.</p>

<p>This means that adding one month and one day to February 28, 2003 will produce the date April 1, 2003, not March 29, 2003.</p>

<pre><code>    my $dt = DateTime-&gt;new( year =&gt; 2003, month =&gt; 2, day =&gt; 28 );

    $dt-&gt;add( months =&gt; 1, days =&gt; 1 );

    # 2003-04-01 - the result</code></pre>

<p>On the other hand, if we add months first, and then separately add days, we end up with March 29, 2003:</p>

<pre><code>    $dt-&gt;add( months =&gt; 1 )-&gt;add( days =&gt; 1 );

    # 2003-03-29</code></pre>

<p>We see similar strangeness when math crosses a DST boundary:</p>

<pre><code>    my $dt = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 5,
        hour      =&gt; 1,
        minute    =&gt; 58,
        time_zone =&gt; &quot;America/Chicago&quot;,
    );

    $dt-&gt;add( days =&gt; 1, minutes =&gt; 3 );
    # 2003-04-06 02:01:00

    $dt-&gt;add( minutes =&gt; 3 )-&gt;add( days =&gt; 1 );
    # 2003-04-06 03:01:00</code></pre>

<p>Note that if you converted the datetime object to UTC first you would get predictable results.</p>

<p>If you want to know how many seconds a <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> object represents, you have to add it to a datetime to find out, so you could do:</p>

<pre><code>    my $now   = DateTime-&gt;now( time_zone =&gt; &#39;UTC&#39; );
    my $later = $now-&gt;clone-&gt;add_duration($duration);

    my $seconds_dur = $later-&gt;subtract_datetime_absolute($now);</code></pre>

<p>This returns a <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> which only contains seconds and nanoseconds.</p>

<p>If we were add the duration to a different <code>DateTime</code> object we might get a different number of seconds.</p>

<p><a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> supports three different end-of-month algorithms for adding months. This comes into play when an addition results in a day past the end of the following month (for example, adding one month to January 30).</p>

<pre><code>    # 2010-08-31 + 1 month = 2010-10-01
    $dt-&gt;add( months =&gt; 1, end_of_month =&gt; &#39;wrap&#39; );

    # 2010-01-30 + 1 month = 2010-02-28
    $dt-&gt;add( months =&gt; 1, end_of_month =&gt; &#39;limit&#39; );

    # 2010-04-30 + 1 month = 2010-05-31
    $dt-&gt;add( months =&gt; 1, end_of_month =&gt; &#39;preserve&#39; );</code></pre>

<p>By default, it uses <code>&quot;wrap&quot;</code> for positive durations and <code>&quot;preserve&quot;</code> for negative durations. See <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> for a detailed explanation of these algorithms.</p>

<p>If you need to do lots of work with durations, take a look at the <a href="https://metacpan.org/pod/DateTime::Format::Duration">DateTime::Format::Duration</a> module, which lets you present information from durations in many useful ways.</p>

<p>There are other subtract/delta methods in <code>DateTime</code> to generate different types of durations. These methods are <code>$dt-&gt;subtract_datetime</code>, <code>$dt-&gt;subtract_datetime_absolute</code>, <code>$dt-&gt;delta_md</code>, <code>$dt-&gt;delta_days</code>, and <code>$dt-&gt;delta_ms</code>.</p>

<h3 id="DateTime-Subtraction"><a id="DateTime9"></a>DateTime Subtraction</h3>

<p>Date subtraction is done based solely on the two object&#39;s local datetimes, with one exception to handle DST changes. Also, if the two datetime objects are in different time zones, one of them is converted to the other&#39;s time zone first before subtraction. This is best explained through examples:</p>

<p>The first of these probably makes the most sense:</p>

<pre><code>    # not DST
    my $dt1 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 5,
        day       =&gt; 6,
        time_zone =&gt; &#39;America/Chicago&#39;,
    );

    # is DST
    my $dt2 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 11,
        day       =&gt; 6,
        time_zone =&gt; &#39;America/Chicago&#39;,
    );

    # 6 months
    my $dur = $dt2-&gt;subtract_datetime($dt1);</code></pre>

<p>Nice and simple.</p>

<p>This one is a little trickier, but still fairly logical:</p>

<pre><code>    # is DST
    my $dt1 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 5,
        hour      =&gt; 1,
        minute    =&gt; 58,
        time_zone =&gt; &quot;America/Chicago&quot;,
    );

    # not DST
    my $dt2 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 7,
        hour      =&gt; 2,
        minute    =&gt; 1,
        time_zone =&gt; &quot;America/Chicago&quot;,
    );

    # 2 days and 3 minutes
    my $dur = $dt2-&gt;subtract_datetime($dt1);</code></pre>

<p>Which contradicts the result this one gives, even though they both make sense:</p>

<pre><code>    # is DST
    my $dt1 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 5,
        hour      =&gt; 1,
        minute    =&gt; 58,
        time_zone =&gt; &quot;America/Chicago&quot;,
    );

    # not DST
    my $dt2 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 6,
        hour      =&gt; 3,
        minute    =&gt; 1,
        time_zone =&gt; &quot;America/Chicago&quot;,
    );

    # 1 day and 3 minutes
    my $dur = $dt2-&gt;subtract_datetime($dt1);</code></pre>

<p>This last example illustrates the &quot;DST&quot; exception mentioned earlier. The exception accounts for the fact 2003-04-06 only lasts 23 hours.</p>

<p>And finally:</p>

<pre><code>    my $dt2 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 10,
        day       =&gt; 26,
        hour      =&gt; 1,
        time_zone =&gt; &#39;America/Chicago&#39;,
    );

    my $dt1 = $dt2-&gt;clone-&gt;subtract( hours =&gt; 1 );

    # 60 minutes
    my $dur = $dt2-&gt;subtract_datetime($dt1);</code></pre>

<p>This seems obvious until you realize that subtracting 60 minutes from <code>$dt2</code> in the above example still leaves the clock time at &quot;01:00:00&quot;. This time we are accounting for a 25 hour day.</p>

<h3 id="Reversibility">Reversibility</h3>

<p>Date math operations are not always reversible. This is because of the way that addition operations are ordered. As was discussed earlier, adding 1 day and 3 minutes in one call to <code>$dt-&gt;add</code> is not the same as first adding 3 minutes and 1 day in two separate calls.</p>

<p>If we take a duration returned from <code>$dt-&gt;subtract_datetime</code> and then try to add or subtract that duration from one of the datetimes we just used, we sometimes get interesting results:</p>

<pre><code>    my $dt1 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 5,
        hour      =&gt; 1,
        minute    =&gt; 58,
        time_zone =&gt; &quot;America/Chicago&quot;,
    );

    my $dt2 = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 6,
        hour      =&gt; 3,
        minute    =&gt; 1,
        time_zone =&gt; &quot;America/Chicago&quot;,
    );

    # 1 day and 3 minutes
    my $dur = $dt2-&gt;subtract_datetime($dt1);

    # gives us $dt2
    $dt1-&gt;add_duration($dur);

    # gives us 2003-04-05 02:58:00 - 1 hour later than $dt1
    $dt2-&gt;subtract_duration($dur);</code></pre>

<p>The <code>$dt-&gt;subtract_duration</code> operation gives us a (perhaps) unexpected answer because it first subtracts one day to get 2003-04-05T03:01:00 and then subtracts 3 minutes to get the final result.</p>

<p>If we explicitly reverse the order we can get the original value of <code>$dt1</code>. This can be facilitated by the <a href="https://metacpan.org/pod/DateTime::Duration">DateTime::Duration</a> class&#39;s <code>$dur-&gt;calendar_duration</code> and <code>$dur-&gt;clock_duration</code> methods:</p>

<pre><code>    $dt2-&gt;subtract_duration( $dur-&gt;clock_duration )
        -&gt;subtract_duration( $dur-&gt;calendar_duration );</code></pre>

<h3 id="Leap-Seconds-and-Date-Math"><a id="Leap"></a>Leap Seconds and Date Math</h3>

<p>The presence of leap seconds can cause even more anomalies in date math. For example, the following is a legal datetime:</p>

<pre><code>    my $dt = DateTime-&gt;new(
        year      =&gt; 1972,
        month     =&gt; 12,
        day       =&gt; 31,
        hour      =&gt; 23,
        minute    =&gt; 59,
        second    =&gt; 60,
        time_zone =&gt; &#39;UTC&#39;
    );</code></pre>

<p>If we add one month ...</p>

<pre><code>    $dt-&gt;add( months =&gt; 1 );</code></pre>

<p>... the datetime is now &quot;1973-02-01 00:00:00&quot;, because there is no 23:59:60 on 1973-01-31.</p>

<p>Leap seconds also force us to distinguish between minutes and seconds during date math. Given the following datetime ...</p>

<pre><code>    my $dt = DateTime-&gt;new(
        year      =&gt; 1972,
        month     =&gt; 12,
        day       =&gt; 31,
        hour      =&gt; 23,
        minute    =&gt; 59,
        second    =&gt; 30,
        time_zone =&gt; &#39;UTC&#39;
    );</code></pre>

<p>... we will get different results when adding 1 minute than we get if we add 60 seconds. This is because in this case, the last minute of the day, beginning at 23:59:00, actually contains 61 seconds.</p>

<p>Here are the results we get:</p>

<pre><code>    # 1972-12-31 23:59:30 - our starting datetime
    my $dt = DateTime-&gt;new(
        year      =&gt; 1972,
        month     =&gt; 12,
        day       =&gt; 31,
        hour      =&gt; 23,
        minute    =&gt; 59,
        second    =&gt; 30,
        time_zone =&gt; &#39;UTC&#39;
    );

    # 1973-01-01 00:00:30 - one minute later
    $dt-&gt;clone-&gt;add( minutes =&gt; 1 );

    # 1973-01-01 00:00:29 - 60 seconds later
    $dt-&gt;clone-&gt;add( seconds =&gt; 60 );

    # 1973-01-01 00:00:30 - 61 seconds later
    $dt-&gt;clone-&gt;add( seconds =&gt; 61 );</code></pre>

<h3 id="Local-vs.-UTC-and-24-hours-vs.-1-day"><a id="Local"></a>Local vs. UTC and 24 hours vs. 1 day</h3>

<p>When math crosses a daylight saving boundary, a single day may have more or less than 24 hours.</p>

<p>For example, if you do this ...</p>

<pre><code>    my $dt = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 5,
        hour      =&gt; 2,
        time_zone =&gt; &#39;America/Chicago&#39;,
    );

    $dt-&gt;add( days =&gt; 1 );</code></pre>

<p>... then you will produce an <i>invalid</i> local time, and therefore an exception will be thrown.</p>

<p>However, this works ...</p>

<pre><code>    my $dt = DateTime-&gt;new(
        year      =&gt; 2003,
        month     =&gt; 4,
        day       =&gt; 5,
        hour      =&gt; 2,
        time_zone =&gt; &#39;America/Chicago&#39;,
    );

    $dt-&gt;add( hours =&gt; 24 );</code></pre>

<p>... and produces a datetime with the local time of &quot;03:00&quot;.</p>

<p>If all this makes your head hurt, there is a simple alternative. Just convert your datetime object to the &quot;UTC&quot; time zone before doing date math on it, and switch it back to the local time zone afterwards. This avoids the possibility of having date math throw an exception, and makes sure that 1 day equals 24 hours. Of course, this may not always be desirable, so caveat user!</p>

<h2 id="Overloading">Overloading</h2>

<p>This module explicitly overloads the addition (+), subtraction (-), string and numeric comparison operators. This means that the following all do sensible things:</p>

<pre><code>    my $new_dt = $dt + $duration_obj;

    my $new_dt = $dt - $duration_obj;

    my $duration_obj = $dt - $new_dt;

    for my $dt ( sort @dts ) {...}</code></pre>

<p>Additionally, the fallback parameter is set to true, so other derivable operators (+=, -=, etc.) will work properly. Do not expect increment (++) or decrement (--) to do anything useful.</p>

<p>The string comparison operators, <code>eq</code> or <code>ne</code>, will use the string value to compare with non-DateTime objects.</p>

<p>DateTime objects do not have a numeric value, using <code>==</code> or <code>&lt;=&gt;</code> to compare a DateTime object with a non-DateTime object will result in an exception. To safely sort mixed DateTime and non-DateTime objects, use <code>sort { $a cmp $b } @dates</code>.</p>

<p>The module also overloads stringification using the object&#39;s formatter, defaulting to <code>iso8601</code> method. See <a href="DateTime.html#Formatters-And-Stringification">&quot;Formatters And Stringification&quot;</a> for details.</p>

<h2 id="Formatters-And-Stringification"><a id="Formatters"></a>Formatters And Stringification</h2>

<p>You can optionally specify a <code>formatter</code>, which is usually a <code>DateTime::Format::*</code> object or class, to control the stringification of the DateTime object.</p>

<p>Any of the constructor methods can accept a formatter argument:</p>

<pre><code>    my $formatter = DateTime::Format::Strptime-&gt;new(...);
    my $dt        = DateTime-&gt;new( year =&gt; 2004, formatter =&gt; $formatter );</code></pre>

<p>Or, you can set it afterwards:</p>

<pre><code>    $dt-&gt;set_formatter($formatter);
    $formatter = $dt-&gt;formatter;</code></pre>

<p>Once you set the formatter, the overloaded stringification method will use the formatter. If unspecified, the <code>iso8601</code> method is used.</p>

<p>A formatter can be handy when you know that in your application you want to stringify your DateTime objects into a special format all the time, for example in Postgres format.</p>

<p>If you provide a formatter class name or object, it must implement a <code>format_datetime</code> method. This method will be called with just the <code>DateTime</code> object as its argument.</p>

<h2 id="CLDR-Patterns"><a id="CLDR"></a>CLDR Patterns</h2>

<p>The CLDR pattern language is both more powerful and more complex than strftime. Unlike strftime patterns, you often have to explicitly escape text that you do not want formatted, as the patterns are simply letters without any prefix.</p>

<p>For example, <code>&quot;yyyy-MM-dd&quot;</code> is a valid CLDR pattern. If you want to include any lower or upper case ASCII characters as-is, you can surround them with single quotes (&#39;). If you want to include a single quote, you must escape it as two single quotes (&#39;&#39;).</p>

<pre><code>    my $pattern1 = q{&#39;Today is &#39; EEEE};
    my $pattern2 = q{&#39;It is now&#39; h &#39;o&#39;&#39;clock&#39; a};</code></pre>

<p>Spaces and any non-letter text will always be passed through as-is.</p>

<p>Many CLDR patterns which produce numbers will pad the number with leading zeroes depending on the length of the format specifier. For example, <code>&quot;h&quot;</code> represents the current hour from 1-12. If you specify <code>&quot;hh&quot;</code> then hours 1-9 will have a leading zero prepended.</p>

<p>However, CLDR often uses five of a letter to represent the narrow form of a pattern. This inconsistency is necessary for backwards compatibility.</p>

<p>There are many cases where CLDR patterns distinguish between the &quot;format&quot; and &quot;stand-alone&quot; forms of a pattern. The format pattern is used when the thing in question is being placed into a larger string. The stand-alone form is used when displaying that item by itself, for example in a calendar.</p>

<p>There are also many cases where CLDR provides three sizes for each item, wide (the full name), abbreviated, and narrow. The narrow form is often just a single character, for example &quot;T&quot; for &quot;Tuesday&quot;, and may not be unique.</p>

<p>CLDR provides a fairly complex system for localizing time zones that we ignore entirely. The time zone patterns just use the information provided by <code>DateTime::TimeZone</code>, and <i>do not follow the CLDR spec</i>.</p>

<p>The output of a CLDR pattern is always localized, when applicable.</p>

<p>CLDR provides the following patterns:</p>

<ul>

<li><p>G{1,3}</p>

<p>The abbreviated era (BC, AD).</p>

</li>
<li><p>GGGG</p>

<p>The wide era (Before Christ, Anno Domini).</p>

</li>
<li><p>GGGGG</p>

<p>The narrow era, if it exists (but it mostly doesn&#39;t).</p>

</li>
<li><p>y and y{3,}</p>

<p>The year, zero-prefixed as needed. Negative years will start with a &quot;-&quot;, and this will be included in the length calculation.</p>

<p>In other, words the &quot;yyyyy&quot; pattern will format year -1234 as &quot;-1234&quot;, not &quot;-01234&quot;.</p>

</li>
<li><p>yy</p>

<p>This is a special case. It always produces a two-digit year, so &quot;1976&quot; becomes &quot;76&quot;. Negative years will start with a &quot;-&quot;, making them one character longer.</p>

</li>
<li><p>Y{1,}</p>

<p>The year in &quot;week of the year&quot; calendars, from <code>$dt-&gt;week_year</code>.</p>

</li>
<li><p>u{1,}</p>

<p>Same as &quot;y&quot; except that &quot;uu&quot; is not a special case.</p>

</li>
<li><p>Q{1,2}</p>

<p>The quarter as a number (1..4).</p>

</li>
<li><p>QQQ</p>

<p>The abbreviated format form for the quarter.</p>

</li>
<li><p>QQQQ</p>

<p>The wide format form for the quarter.</p>

</li>
<li><p>q{1,2}</p>

<p>The quarter as a number (1..4).</p>

</li>
<li><p>qqq</p>

<p>The abbreviated stand-alone form for the quarter.</p>

</li>
<li><p>qqqq</p>

<p>The wide stand-alone form for the quarter.</p>

</li>
<li><p>M{1,2}</p>

<p>The numerical month.</p>

</li>
<li><p>MMM</p>

<p>The abbreviated format form for the month.</p>

</li>
<li><p>MMMM</p>

<p>The wide format form for the month.</p>

</li>
<li><p>MMMMM</p>

<p>The narrow format form for the month.</p>

</li>
<li><p>L{1,2}</p>

<p>The numerical month.</p>

</li>
<li><p>LLL</p>

<p>The abbreviated stand-alone form for the month.</p>

</li>
<li><p>LLLL</p>

<p>The wide stand-alone form for the month.</p>

</li>
<li><p>LLLLL</p>

<p>The narrow stand-alone form for the month.</p>

</li>
<li><p>w{1,2}</p>

<p>The week of the year, from <code>$dt-&gt;week_number</code>.</p>

</li>
<li><p>W</p>

<p>The week of the month, from <code>$dt-&gt;week_of_month</code>.</p>

</li>
<li><p>d{1,2}</p>

<p>The numeric day of the month.</p>

</li>
<li><p>D{1,3}</p>

<p>The numeric day of the year.</p>

</li>
<li><p>F</p>

<p>The day of the week in the month, from <code>$dt-&gt;weekday_of_month</code>.</p>

</li>
<li><p>g{1,}</p>

<p>The modified Julian day, from <code>$dt-&gt;mjd</code>.</p>

</li>
<li><p>E{1,3} and eee</p>

<p>The abbreviated format form for the day of the week.</p>

</li>
<li><p>EEEE and eeee</p>

<p>The wide format form for the day of the week.</p>

</li>
<li><p>EEEEE and eeeee</p>

<p>The narrow format form for the day of the week.</p>

</li>
<li><p>e{1,2}</p>

<p>The <i>local</i> numeric day of the week, from 1 to 7. This number depends on what day is considered the first day of the week, which varies by locale. For example, in the US, Sunday is the first day of the week, so this returns 2 for Monday.</p>

</li>
<li><p>c</p>

<p>The numeric day of the week from 1 to 7, treating Monday as the first of the week, regardless of locale.</p>

</li>
<li><p>ccc</p>

<p>The abbreviated stand-alone form for the day of the week.</p>

</li>
<li><p>cccc</p>

<p>The wide stand-alone form for the day of the week.</p>

</li>
<li><p>ccccc</p>

<p>The narrow format form for the day of the week.</p>

</li>
<li><p>a</p>

<p>The localized form of AM or PM for the time.</p>

</li>
<li><p>h{1,2}</p>

<p>The hour from 1-12.</p>

</li>
<li><p>H{1,2}</p>

<p>The hour from 0-23.</p>

</li>
<li><p>K{1,2}</p>

<p>The hour from 0-11.</p>

</li>
<li><p>k{1,2}</p>

<p>The hour from 1-24.</p>

</li>
<li><p>j{1,2}</p>

<p>The hour, in 12 or 24 hour form, based on the preferred form for the locale. In other words, this is equivalent to either &quot;h{1,2}&quot; or &quot;H{1,2}&quot;.</p>

</li>
<li><p>m{1,2}</p>

<p>The minute.</p>

</li>
<li><p>s{1,2}</p>

<p>The second.</p>

</li>
<li><p>S{1,}</p>

<p>The fractional portion of the seconds, rounded based on the length of the specifier. This returned <i>without</i> a leading decimal point, but may have leading or trailing zeroes.</p>

</li>
<li><p>A{1,}</p>

<p>The millisecond of the day, based on the current time. In other words, if it is 12:00:00.00, this returns 43200000.</p>

</li>
<li><p>z{1,3}</p>

<p>The time zone short name.</p>

</li>
<li><p>zzzz</p>

<p>The time zone long name.</p>

</li>
<li><p>Z{1,3}</p>

<p>The time zone offset.</p>

</li>
<li><p>ZZZZ</p>

<p>The time zone short name and the offset as one string, so something like &quot;CDT-0500&quot;.</p>

</li>
<li><p>ZZZZZ</p>

<p>The time zone offset as a sexagesimal number, so something like &quot;-05:00&quot;. (This is useful for W3C format.)</p>

</li>
<li><p>v{1,3}</p>

<p>The time zone short name.</p>

</li>
<li><p>vvvv</p>

<p>The time zone long name.</p>

</li>
<li><p>V{1,3}</p>

<p>The time zone short name.</p>

</li>
<li><p>VVVV</p>

<p>The time zone long name.</p>

</li>
</ul>

<h3 id="CLDR-&quot;Available-Formats&quot;"><a id="CLDR1"></a><a id="CLDR--Available-Formats"></a>CLDR &quot;Available Formats&quot;</h3>

<p>The CLDR data includes pre-defined formats for various patterns such as &quot;month and day&quot; or &quot;time of day&quot;. Using these formats lets you render information about a datetime in the most natural way for users from a given locale.</p>

<p>These formats are indexed by a key that is itself a CLDR pattern. When you look these up, you get back a different CLDR pattern suitable for the locale.</p>

<p>Let&#39;s look at some example We&#39;ll use <code>2008-02-05T18:30:30</code> as our example datetime value, and see how this is rendered for the <code>&quot;en-US&quot;</code> and <code>&quot;fr-FR&quot;</code> locales.</p>

<ul>

<li><p><code>MMMd</code></p>

<p>The abbreviated month and day as number. For <code>en-US</code>, we get the pattern <code>MMM d</code>, which renders as <code>Feb 5</code>. For <code>fr-FR</code>, we get the pattern <code>d MMM</code>, which renders as <code>5 f&eacute;vr.</code>.</p>

</li>
<li><p><code>yQQQ</code></p>

<p>The year and abbreviated quarter of year. For <code>en-US</code>, we get the pattern <code>QQQ y</code>, which renders as <code>Q1 2008</code>. For <code>fr-FR</code>, we get the same pattern, <code>QQQ y</code>, which renders as <code>T1 2008</code>.</p>

</li>
<li><p><code>hm</code></p>

<p>The 12-hour time of day without seconds. For <code>en-US</code>, we get the pattern <code>h:mm a</code>, which renders as <code>6:30 PM</code>. For <code>fr-FR</code>, we get the exact same pattern and rendering.</p>

</li>
</ul>

<p>The available formats for each locale are documented in the POD for that locale. To get back the format, you use the <code>$locale-&gt;format_for</code> method. For example:</p>

<pre><code>    say $dt-&gt;format_cldr( $dt-&gt;locale-&gt;format_for(&#39;MMMd&#39;) );</code></pre>

<h2 id="strftime-Patterns"><a id="strftime"></a>strftime Patterns</h2>

<p>The following patterns are allowed in the format string given to the <code>$dt-&gt;strftime</code> method:</p>

<ul>

<li><p>%a</p>

<p>The abbreviated weekday name.</p>

</li>
<li><p>%A</p>

<p>The full weekday name.</p>

</li>
<li><p>%b</p>

<p>The abbreviated month name.</p>

</li>
<li><p>%B</p>

<p>The full month name.</p>

</li>
<li><p>%c</p>

<p>The default datetime format for the object&#39;s locale.</p>

</li>
<li><p>%C</p>

<p>The century number (year/100) as a 2-digit integer.</p>

</li>
<li><p>%d</p>

<p>The day of the month as a decimal number (range 01 to 31).</p>

</li>
<li><p>%D</p>

<p>Equivalent to %m/%d/%y. This is not a good standard format if you want folks from both the United States and the rest of the world to understand the date!</p>

</li>
<li><p>%e</p>

<p>Like %d, the day of the month as a decimal number, but a leading zero is replaced by a space.</p>

</li>
<li><p>%F</p>

<p>Equivalent to %Y-%m-%d (the ISO 8601 date format)</p>

</li>
<li><p>%G</p>

<p>The ISO 8601 year with century as a decimal number. The 4-digit year corresponding to the ISO week number (see %V). This has the same format and value as %Y, except that if the ISO week number belongs to the previous or next year, that year is used instead. (TZ)</p>

</li>
<li><p>%g</p>

<p>Like %G, but without century, i.e., with a 2-digit year (00-99).</p>

</li>
<li><p>%h</p>

<p>Equivalent to %b.</p>

</li>
<li><p>%H</p>

<p>The hour as a decimal number using a 24-hour clock (range 00 to 23).</p>

</li>
<li><p>%I</p>

<p>The hour as a decimal number using a 12-hour clock (range 01 to 12).</p>

</li>
<li><p>%j</p>

<p>The day of the year as a decimal number (range 001 to 366).</p>

</li>
<li><p>%k</p>

<p>The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also %H.)</p>

</li>
<li><p>%l</p>

<p>The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also %I.)</p>

</li>
<li><p>%m</p>

<p>The month as a decimal number (range 01 to 12).</p>

</li>
<li><p>%M</p>

<p>The minute as a decimal number (range 00 to 59).</p>

</li>
<li><p>%n</p>

<p>A newline character.</p>

</li>
<li><p>%N</p>

<p>The fractional seconds digits. Default is 9 digits (nanoseconds).</p>

<pre><code>    %3N   milliseconds (3 digits)
    %6N   microseconds (6 digits)
    %9N   nanoseconds  (9 digits)</code></pre>

<p>This value will always be rounded down to the nearest integer.</p>

</li>
<li><p>%p</p>

<p>Either `AM&#39; or `PM&#39; according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm&#39; and midnight as `am&#39;.</p>

</li>
<li><p>%P</p>

<p>Like %p but in lowercase: `am&#39; or `pm&#39; or a corresponding string for the current locale.</p>

</li>
<li><p>%r</p>

<p>The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to `%I:%M:%S %p&#39;.</p>

</li>
<li><p>%R</p>

<p>The time in 24-hour notation (%H:%M). (SU) For a version including the seconds, see %T below.</p>

</li>
<li><p>%s</p>

<p>The number of seconds since the epoch.</p>

</li>
<li><p>%S</p>

<p>The second as a decimal number (range 00 to 61).</p>

</li>
<li><p>%t</p>

<p>A tab character.</p>

</li>
<li><p>%T</p>

<p>The time in 24-hour notation (%H:%M:%S).</p>

</li>
<li><p>%u</p>

<p>The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w.</p>

</li>
<li><p>%U</p>

<p>The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also %V and %W.</p>

</li>
<li><p>%V</p>

<p>The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. See also %U and %W.</p>

</li>
<li><p>%w</p>

<p>The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u.</p>

</li>
<li><p>%W</p>

<p>The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.</p>

</li>
<li><p>%x</p>

<p>The default date format for the object&#39;s locale.</p>

</li>
<li><p>%X</p>

<p>The default time format for the object&#39;s locale.</p>

</li>
<li><p>%y</p>

<p>The year as a decimal number without a century (range 00 to 99).</p>

</li>
<li><p>%Y</p>

<p>The year as a decimal number including the century.</p>

</li>
<li><p>%z</p>

<p>The time-zone as hour offset from UTC. Required to emit RFC822-conformant dates (using &quot;%a, %d %b %Y %H:%M:%S %z&quot;).</p>

</li>
<li><p>%Z</p>

<p>The short name for the time zone, typically an abbreviation like &quot;EST&quot; or &quot;AEST&quot;.</p>

</li>
<li><p>%%</p>

<p>A literal `%&#39; character.</p>

</li>
<li><p>%{method}</p>

<p>Any method name may be specified using the format <code>%{method}</code> name where &quot;method&quot; is a valid <code>DateTime</code> object method.</p>

</li>
</ul>

<h2 id="DateTime-and-Storable"><a id="DateTime10"></a>DateTime and Storable</h2>

<p><code>DateTime</code> implements <a href="https://metacpan.org/pod/Storable">Storable</a> hooks in order to reduce the size of a serialized <code>DateTime</code> object.</p>

<h1 id="DEVELOPMENT-TOOLS"><a id="DEVELOPMENT"></a>DEVELOPMENT TOOLS</h1>

<p>If you&#39;re working on the <code>DateTIme</code> code base, there are a few extra non-Perl tools that you may find useful, notably <a href="https://github.com/houseabsolute/precious">precious</a>, a meta-linter/tidier. You can install all the necessary tools in <code>$HOME/bin</code> by running <i>./dev-bin/install-dev-tools.sh</i>.</p>

<p>Try running <code>precious tidy -a</code> to tidy all the tidyable files in the repo, and <code>precious lint -a</code> to run all the lint checks.</p>

<p>You can enable a git pre-commit hook for linting by running <i>./git/setup.pl</i>.</p>

<p>Note that linting will be checked in CI, and it&#39;s okay to submit a PR which fails the linting check, but it&#39;s extra nice to fix these yourself.</p>

<h1 id="THE-DATETIME-PROJECT-ECOSYSTEM"><a id="THE"></a>THE DATETIME PROJECT ECOSYSTEM</h1>

<p>This module is part of a larger ecosystem of modules in the DateTime family.</p>

<h2 id="DateTime::Set"><a id="DateTime11"></a><a href="https://metacpan.org/pod/DateTime::Set">DateTime::Set</a></h2>

<p>The <a href="https://metacpan.org/pod/DateTime::Set">DateTime::Set</a> module represents sets (including recurrences) of datetimes. Many modules return sets or recurrences.</p>

<h2 id="Format-Modules"><a id="Format"></a>Format Modules</h2>

<p>The various format modules exist to parse and format datetimes. For example, <a href="https://metacpan.org/pod/DateTime::Format::HTTP">DateTime::Format::HTTP</a> parses dates according to the RFC 1123 format:</p>

<pre><code>    my $datetime
        = DateTime::Format::HTTP-&gt;parse_datetime(
        &#39;Thu Feb  3 17:03:55 GMT 1994&#39;);

    print DateTime::Format::HTTP-&gt;format_datetime($datetime);</code></pre>

<p>Most format modules are suitable for use as a <code>formatter</code> with a DateTime object.</p>

<p>All format modules start with <a href="https://metacpan.org/search?q=datetime%3A%3Aformat">DateTime::Format::</a>.</p>

<h2 id="Calendar-Modules"><a id="Calendar"></a>Calendar Modules</h2>

<p>There are a number of modules on CPAN that implement non-Gregorian calendars, such as the Chinese, Mayan, and Julian calendars.</p>

<p>All calendar modules start with <a href="https://metacpan.org/search?q=datetime%3A%3Acalendar">DateTime::Calendar::</a>.</p>

<h2 id="Event-Modules"><a id="Event"></a>Event Modules</h2>

<p>There are a number of modules that calculate the dates for events, such as Easter, Sunrise, etc.</p>

<p>All event modules start with <a href="https://metacpan.org/search?q=datetime%3A%3Aevent">DateTime::Event::</a>.</p>

<h2 id="Others">Others</h2>

<p>There are many other modules that work with DateTime, including modules in the <a href="https://metacpan.org/search?q=datetimex">DateTimeX namespace</a> namespace, as well as others.</p>

<p>See <a href="https://metacpan.org/search?q=datetime">MetaCPAN</a> for more modules.</p>

<h1 id="KNOWN-BUGS"><a id="KNOWN"></a>KNOWN BUGS</h1>

<p>The tests in <i>20infinite.t</i> seem to fail on some machines, particularly on Win32. This appears to be related to Perl&#39;s internal handling of IEEE infinity and NaN, and seems to be highly platform/compiler/phase of moon dependent.</p>

<p>If you don&#39;t plan to use infinite datetimes you can probably ignore this. This will be fixed (perhaps) in future versions.</p>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="http://presentations.houseabsolute.com/a-date-with-perl/">A Date with Perl</a> - a talk I&#39;ve given at a few YAPCs.</p>

<p><a href="http://lists.perl.org/list/datetime.html">datetime@perl.org mailing list</a></p>

<h1 id="SUPPORT">SUPPORT</h1>

<p>Bugs may be submitted at <a href="https://github.com/houseabsolute/DateTime.pm/issues">https://github.com/houseabsolute/DateTime.pm/issues</a>.</p>

<p>There is a mailing list available for users of this distribution, <a href="mailto:datetime@perl.org">mailto:datetime@perl.org</a>.</p>

<h1 id="SOURCE">SOURCE</h1>

<p>The source code repository for DateTime can be found at <a href="https://github.com/houseabsolute/DateTime.pm">https://github.com/houseabsolute/DateTime.pm</a>.</p>

<h1 id="DONATIONS">DONATIONS</h1>

<p>If you&#39;d like to thank me for the work I&#39;ve done on this module, please consider making a &quot;donation&quot; to me via PayPal. I spend a lot of free time creating free software, and would appreciate any support you&#39;d care to offer.</p>

<p>Please note that <b>I am not suggesting that you must do this</b> in order for me to continue working on this particular software. I will continue to do so, inasmuch as I have in the past, for as long as it interests me.</p>

<p>Similarly, a donation made in this way will probably not make me work on this software much more, unless I get so many donations that I can consider working on free software full time (let&#39;s all have a chuckle at that together).</p>

<p>To donate, log into PayPal and send money to autarch@urth.org, or use the button at <a href="https://houseabsolute.com/foss-donations/">https://houseabsolute.com/foss-donations/</a>.</p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Dave Rolsky &lt;autarch@urth.org&gt;</p>

<h1 id="CONTRIBUTORS">CONTRIBUTORS</h1>

<ul>

<li><p>Ben Bennett &lt;fiji@limey.net&gt;</p>

</li>
<li><p>Christian Hansen &lt;chansen@cpan.org&gt;</p>

</li>
<li><p>Daisuke Maki &lt;dmaki@cpan.org&gt;</p>

</li>
<li><p>Dan Book &lt;grinnz@gmail.com&gt;</p>

</li>
<li><p>Dan Stewart &lt;danielandrewstewart@gmail.com&gt;</p>

</li>
<li><p>David Dyck &lt;david.dyck@checksum.com&gt;</p>

</li>
<li><p>David E. Wheeler &lt;david@justatheory.com&gt;</p>

</li>
<li><p>David Precious &lt;davidp@preshweb.co.uk&gt;</p>

</li>
<li><p>Doug Bell &lt;madcityzen@gmail.com&gt;</p>

</li>
<li><p>Fl&aacute;vio Soibelmann Glock &lt;fglock@gmail.com&gt;</p>

</li>
<li><p>Gianni Ceccarelli &lt;gianni.ceccarelli@broadbean.com&gt;</p>

</li>
<li><p>Gregory Oschwald &lt;oschwald@gmail.com&gt;</p>

</li>
<li><p>Hauke D &lt;haukex@zero-g.net&gt;</p>

</li>
<li><p>Iain Truskett &lt;deceased&gt;</p>

</li>
<li><p>James Raspass &lt;jraspass@gmail.com&gt;</p>

</li>
<li><p>Jason McIntosh &lt;jmac@jmac.org&gt;</p>

</li>
<li><p>Joshua Hoblitt &lt;jhoblitt@cpan.org&gt;</p>

</li>
<li><p>Karen Etheridge &lt;ether@cpan.org&gt;</p>

</li>
<li><p>Mark Overmeer &lt;mark@overmeer.net&gt;</p>

</li>
<li><p>Michael Conrad &lt;mike@nrdvana.net&gt;</p>

</li>
<li><p>Michael R. Davis &lt;mrdvt92@users.noreply.github.com&gt;</p>

</li>
<li><p>Mohammad S Anwar &lt;mohammad.anwar@yahoo.com&gt;</p>

</li>
<li><p>M Somerville &lt;dracos@users.noreply.github.com&gt;</p>

</li>
<li><p>Nick Tonkin &lt;1nickt@users.noreply.github.com&gt;</p>

</li>
<li><p>Olaf Alders &lt;olaf@wundersolutions.com&gt;</p>

</li>
<li><p>Ovid &lt;curtis_ovid_poe@yahoo.com&gt;</p>

</li>
<li><p>Paul Howarth &lt;paul@city-fan.org&gt;</p>

</li>
<li><p>Philippe Bruhat (BooK) &lt;book@cpan.org&gt;</p>

</li>
<li><p>philip r brenan &lt;philiprbrenan@gmail.com&gt;</p>

</li>
<li><p>Ricardo Signes &lt;rjbs@cpan.org&gt;</p>

</li>
<li><p>Richard Bowen &lt;bowen@cpan.org&gt;</p>

</li>
<li><p>Ron Hill &lt;rkhill@cpan.org&gt;</p>

</li>
<li><p>Sam Kington &lt;github@illuminated.co.uk&gt;</p>

</li>
<li><p>viviparous &lt;viviparous@prc&gt;</p>

</li>
</ul>

<h1 id="COPYRIGHT-AND-LICENSE"><a id="COPYRIGHT"></a>COPYRIGHT AND LICENSE</h1>

<p>This software is Copyright (c) 2003 - 2023 by Dave Rolsky.</p>

<p>This is free software, licensed under:</p>

<pre><code>  The Artistic License 2.0 (GPL Compatible)</code></pre>

<p>The full text of the license can be found in the <i>LICENSE</i> file included with this distribution.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install DateTime, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm DateTime</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install DateTime</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="DateTime.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
